marklogic - Efficient XQuery query to determine the documents where an element does NOT exist -


let's have ~50 million records in collection this:

<record>   <some_data>     <some_data_id>112423425345235</some_data_id>   </some_data> </record> 

so have maybe million records (bad data) this:

<record>   <some_data>   </some_data> </record> 

with some_data element being empty. if have element-range-index setup on some_data_id, what's efficient xquery query give me empty ones delete?

i think i'm looking query not flwor check existence of children records each element, think inefficient (i.e. pulling data , filtering)?

whereas if did in cts:search query more efficient, in filter data before pulling back?

please write query can efficiently , confirm whether or not assumptions flwor statements correct.

i don't think need range index efficiently. using "universal" element indexes via cts:query constructors should fine:

cts:element-query(xs:qname('record'),   cts:element-query(xs:qname('some_data'),     cts:not-query(cts:element-query(xs:qname('some_data_id'), cts:and-query(())))   ) ) 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -