Besides fields, it's also possible to write queries like this:

//Permission[access = "deny" and name = "execute"]

MarkLogic can resolve this out of indexes if you have enabled the right 
position indexes.  My notes show you need element-value-positions and 
word-positions enabled (but I haven't verified myself).

This will in some cases be more flexible than fields, such as when you don't 
know the order of elements.  Fields would perform faster as they can avoid the 
position calculations.

-jh-

On Jul 19, 2011, at 9:35 AM, Gary Larsen wrote:

> I need to filter on the data structure below using a combination of both the 
> <name> and <access> values.
>  
> <permissions>
>     <Permission>
>         <access>deny</access>
>         <name>execute</name>
>     </Permission>
>     <Permission>
>         <access>grant</access>
>         <name>traverse</name>
>     </Permission>
> </permissions>
>  
> It seems one way to accomplish this is to create a fragment root on the 
> Permission element.  (This would create very large number of fragments.)
>  
> I also thought that a field defined on the Permission element (the only 
> include, no excludes) would work – as long as the descendant values were 
> always appended in order.  For example:
>  
>   cts:field-word-query('permissionField', 'denyexecute')
>  
> Can I rely on that?  Are there other possible solutions?
>  
> Thanks,
> gary
> _______________________________________________
> 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