Thanks Jason,

 

Although I'm more at home using XPath queries, much of what executes needs
to be returned in groups.  Because of this I'm using cts:search with a
constraining queries to perform the filtering.  Though I often use XPath on
the cts:search results.

 

I have not yet paid enough attention to index options.  It does seem that
those to options would apply with the cts element queries.

gary  

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Jason Hunter
Sent: Tuesday, July 19, 2011 1:46 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Question on fields

 

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