Hi Coleen, Thanks for coming back and finishing your reply. I was a little puzzled after the first bit :-)
I will certainly take a look at the NEAR joiner to see if I can derive an IN joiner from it. Surely someone has done this before, as it is common to need a match for anything in a set of values. So the ability to pass a list of values to some cts queries is what you regard as a shotgun OR? I assume this is an efficient process and can handle huge lists. Of course we would not be passing a long list of values to the search API. In those cases I would go straight to cts search. But only a handful of ORs makes for an ugly query string. An IN clause is perfect for this. Many thanks Gavin Sent from Gavin's iPhone On 28 Feb 2013, at 19:33, "Colleen Whitney" <[email protected]> wrote: > Whoops, let me try to finish that thought, sorry, I went back to look again > at your example just as the Web mail client prematurely sent the message. > > You're actually asking about a joiner that expands the list to a shotgun OR > of constrained queries.. > > I think it could be done using a custom joiner modelled on NEAR. > > --C > > Colleen Whitney > MarkLogic Corporation > > Phone +1 650 655 2366 > email [email protected] > web www.marklogic.com > > This e-mail and any accompanying attachments are confidential. The > information is intended solely for the use of the individual to whom it is > addressed. Any review, disclosure, copying, distribution, or use of this > e-mail communication by others is strictly prohibited. If you are not the > intended recipient, please notify us immediately by returning this message to > the sender and delete all copies. Thank you for your cooperation. > > ________________________________________ > From: [email protected] > [[email protected]] on behalf of Colleen Whitney > [[email protected]] > Sent: Thursday, February 28, 2013 11:20 AM > To: MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] Search 'in' clause > > Hi Gavin, > > I think it could be done by writing a custom prefix operator, along the > pattern of the - (not) operator in the built-in grammar. > > If you look at parser output from from this query: > > > ________________________________________ > From: [email protected] > [[email protected]] on behalf of Gavin Haydon > [[email protected]] > Sent: Thursday, February 28, 2013 11:02 AM > To: General List > Subject: [MarkLogic Dev General] Search 'in' clause > > Hi > > In the search API is there any way for the grammar to allow something like an > 'in' clause with a list of values. The underlying cts queries can be given a > list of values, so it would be useful if the higher level search grammar > could pass such a list down. > > For instance, given a defined constraint called 'subject' you could do > something like: > subject IN (foo, bar) > Where the comma is a configured separator. > > Instead of: > subject:foo OR subject:bar > > Given a long list of values, would this not be more optimal than a sequence > or OR terms? > > Regards > Gavin Haydon > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
