You can do cts:not-query(cts:element-query(xs:QName("TITLE"),
cts:and-query(()))) to find documents that don't have any TITLE
elements. I don't know how to do that in the search api, though.
-Mike
On 1/3/2012 8:48 AM, Mariano Grau Calín wrote:
Hi all,
We want to find documents where a node tag not exist.
By example, this query return documents where TITLE has a value. The
opposite we want.
doc()/DOC[AGENCY='EFE' and TITLE]
If we try to negate query, result is not like expected.
doc()/DOC[AGENCY='Grupo Joly' and TITLE[text() is null]] (: same result :)
doc()/DOC[AGENCY='EFE' and not(TITLE)] (: all documents where TITLE
exists or not exists :)
doc()/DOC[AGENCY='EFE' and TITLE=''] (: zero results!!! :)
Really, we'd like to define a constraint in search api and to write
something like:
search:search('title:null age:efe)
Or otherwise a additionat-query with cts:query code.
Regards,
Mariano Grau
mgrau @ grupojoly.com
Dpto. Sistemas
Grupo Joly
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general