There is an element-exists termlist entry, so cts:element-query(xs:QName('p'), 
cts:and-query(())) is fast.

Element-attribute values and element-attribute words are indexed by default. 
But attribute values and words are indexed as dependents on a parent element. I 
don't think there's an existence termlist entry for attributes, with or without 
a parent element. So cts:element-attribute-value-query(xs:QName('p'), 
xs:QName('id'), 'fubar') is fast. But there's no default index for a 
cts:element-attribute-query(xs:QName('p'), xs:QName('id'), cts:and-query(())) 
to use.

In theory I think a cts:element-attribute-query term could use a range index on 
that element-attribute if it existed, and simply ignore the values. But there 
might be a technical obstacle, and in any case I haven't heard much demand for 
it.

-- Mike

On 30 Jan 2014, at 13:36 , Geert J. <[email protected]> wrote:

> Hi,
> 
> http://stackoverflow.com/questions/21434099/checking-presence-of-attribute
> -with-ctsquery
> 
> Was looking at this stackoverflow question, and couldn't help wondering
> why isn't there a cts:element-attribute-query function. Because attributes
> are not indexed by default?
> 
> Cheers
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
> 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to