Seems like you could get the functionality you want just using the default 
grammar of search:search.

Just make the search phrase be: "test AND test2 OR test 3 AND -test4"

By default using "AND" and "OR" in capitals does boolean logic in search:search 
and the "-" does a "NOT" condition. I'd try that first to see if it gets you 
what you want.

Date: Mon, 2 May 2011 13:37:08 +0530
From: ambikaarumuga...@gmail.com
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Reg: Advanced search query formation

Hi all,I am working with an advanced  search functionality in which i have to 
search against anyfield in a xml and the input  for it is

 'AnyField:"test" AND AnyField:"test2" OR Anyfield:"test3" NOT 
AnyField:"test4"'.

I would like to get the results in a such a way that, should return the 
documents which has element values "test" and "test2" may be "test3" and should 
not contain "test4". 
>From my understanding i can use word-query with cts:and-query,cts:or-query and 
>cts:not-query combination's. But i would like to know how to split the input 
>string to form the query for different and,or and not combinations.There can 
>be any number AnyField: combinations as an input.
Please suggest how to get this done.Thanks in advance,
Ambika


_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general                         
                  
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to