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
   

[email protected] wrote: -----
To: MarkLogic Developer Discussion <[email protected]>
From: Geert Josten 
Sent by: [email protected]
Date: 11/21/2013 02:49AM
Cc: [email protected]
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 
&#8220;stop&#8221;[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 &#8220;stop stop&#8221;[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 
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to