Hi Abhishek,
As far as I know you can only achieve that by filtering afterwards on item-frequency for that term on each result document, even with MarkLogic 7.0-1. But that is going to be expensive I’m afraid. Would be interesting if there would be a far-query, or something like a min-distance option in near-query. Or perhaps something to query on item-frequency.. Kind regards, Geert *Van:* Srivastava, Abhisekh [mailto:[email protected]] *Verzonden:* woensdag 20 november 2013 22:40 *Aan:* Geert Josten *CC:* MarkLogic Developer Discussion *Onderwerp:* RE: [MarkLogic Dev General] Proximity Search: Behavior with similar terms Hi Geert, Thanks for replying. Actually my requirement is to return documents “test2.xml” and “test3.xml” but exclude “test1.xml” (since it has one occurrence of “stop” ) whereas the behavior is different with current version of MarkLogic (4.2-7) in our shop. Let me know if you think some workaround to achieve this with 4.2-7 Thanks Abhishek *From:* Geert Josten [mailto:[email protected] <[email protected]>] *Sent:* Wednesday, November 20, 2013 4:19 PM *To:* MarkLogic Developer Discussion *Cc:* Srivastava, Abhisekh *Subject:* RE: [MarkLogic Dev General] Proximity Search: Behavior with similar terms Hi Abhishek, When I test this in MarkLogic 7.0-1 with the following, it returns all three examples: xdmp:document-insert("/test1.xml", <x>stop</x>); xdmp:document-insert("/test2.xml", <x>stop stop</x>); xdmp:document-insert("/test3.xml", <x>stop stop stop</x>); cts:search( fn:doc(), cts:near-query( (cts:word-query("stop"),cts:word-query("stop")), 1,"ordered" ), "unfiltered" ) Note that the distance argument is a max-distance. Documents with one occurrence will therefor always match. Or actually, it will match any document with at least one occurrence if you do a near query for the same term. It becomes more clear if you also look at this example, which only returns the second doc: xdmp:document-insert("/test1.xml", <x>stop</x>); xdmp:document-insert("/test2.xml", <x>stop stop2</x>); xdmp:document-insert("/test3.xml", <x>stop2 stop3 stop4</x>); cts:search( fn:doc(), cts:near-query( (cts:word-query("stop"),cts:word-query("stop2")), 1,"ordered" ), "unfiltered" ) Are you sure documents with multiple occurrences are excluded? Which version of MarkLogic are you running? Have you word positions enabled? Kind regards, Geert *Van:* [email protected] [mailto: [email protected]] *Namens *Abhishek53 S *Verzonden:* woensdag 20 november 2013 20:50 *Aan:* MarkLogic Developer Discussion *CC:* [email protected] *Onderwerp:* [MarkLogic Dev General] Proximity Search: Behavior with similar terms Hi All, Please let me know if there is any workaround for below scenario *Current MarkLogic Behavior: Below query returning documents where the word “stop”[only one occurrence] is present in the document* cts:search( fn:doc(), cts:near-query( (cts:word-query("stop"),cts:word-query("stop")), 1,"ordered" ), "unfiltered" ) *Expected Behavior: Return documents where “stop stop”[two terms adjacent to each other] phrase is present* Please advise. Abhishek Srivastav Tata Consultancy Services Cell:- 609-865-1885 Mailto: [email protected] Website: http://www.tcs.com ____________________________________________ Experience certainty. IT Services Business Solutions Consulting ____________________________________________ =====-----=====-----===== 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 ------------------------------ The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. McGraw Hill Financial reserves the right, subject to applicable local law, to monitor, review and process the content of any electronic message or information sent to or from McGraw Hill Financial e-mail addresses without informing the sender or recipient of the message. By sending electronic message or information to McGraw Hill Financial e-mail addresses you, as the sender, are consenting to McGraw Hill Financial processing any of your personal data therein.
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
