[MarkLogic Dev General] Using search:search with basic logic

Will Thompson wthompson at jonesmcclure.com
Wed Mar 14 15:09:47 PDT 2012


Steve,

It just ANDs them by default, but you can still OR constraints, i.e.: "(User:YYY OR DocType:XXX)"

-Will

From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Steve Adcock
Sent: Wednesday, March 14, 2012 2:57 PM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Using search:search with basic logic

Guys,

Trying to figure out the best way to extend a portion of an application that I'm working on that uses the search:search feature of MarkLogic.  Here's the deal...in MarkLogic, we are storing a bunch of documents, and each document contains something of a DocType node.  We also have a bunch of constraint tags that restrict the data coming back, and one of those constraints does a restriction based on the user that inserted the document.  So by default, users only see the documents that they inserted.

However, I want to extend this functionality so it maintains its user restriction, but for a DocType of "XXX", I want to return that as well.  So basically, return all user documents, AND all XXX DocType documents.

Is there a decent way to add this functionality using constraints?  I'd rather not issue another query if at all possible.  What's the most efficient way to do this?

Thanks.

--
Steve Adcock - Software Developer
42Six Solutions | Tucson, AZ
(o) 520.269.7500<tel:520.269.7500>
(c) 520.975.3867<tel:520.975.3867>
http://www.42six.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20120314/bb7c2396/attachment.html 


More information about the General mailing list