Hi Ambika I guess you no need to create any cts query (cts:and-query , cts:or-query, cts:not-query) from query text. You can do it either way Use the search:parse API and override the Marklogic existing grammar accordingly. Pass the queryXML (search:parse() output) to the search:resolve API. Use the search:search API and directly pass the query text as input.
In both the scenario you just need to create the constraint over the specific field. Thanks & Regards Abhishek Srivastav Assistant Systems Engineer Tata Consultancy Services Plot B-1, Block EP & GP, Sector 5 Salt Lake Electronics Complex, Kolkata - 700 091,West Bengal India Cell:- +91-9883389968 Mailto: abhishek5...@tcs.com Website: http://www.tcs.com ____________________________________________ Experience certainty. IT Services Business Solutions Outsourcing ____________________________________________ From: ambika arumugam <ambikaarumuga...@gmail.com> To: General MarkLogic Developer Discussion <general@developer.marklogic.com> Date: 05/02/2011 01:37 PM Subject: [MarkLogic Dev General] Reg: Advanced search query formation Sent by: general-boun...@developer.marklogic.com 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 =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general