Hi,

I am using the search:search API in ML with a few search options. The search 
terms are passed in the options tag. However, there is a mismatch between the 
"total" count shown in the search response and the number of search results. 
This happens after introducing cts:near-query() as one of the additional 
queries in search options. The details are given below:

Query:

let $searchOptions :=
<options xmlns="http://marklogic.com/appservices/search";>
  <debug>false</debug>
  <search-option>score-logtfidf</search-option>
  <term>
    <term-option>case-insensitive</term-option>
    <term-option>diacritic-insensitive</term-option>
    <term-option>punctuation-insensitive</term-option>
  </term>
-----
-----
   <additional-query>
       <cts:and-query xmlns:cts=http://marklogic.com/cts>
          <cts:directory-query depth="infinity">
           -----
                (: few options here:)
           -----
          </cts:directory-query>
           <cts:near-query distance="10" xmlns:cts="http://marklogic.com/cts";>
             <cts:word-query>
                 <cts:text xml:lang="en">fonds commerce</cts:text>
             </cts:word-query>
             <cts:word-query>
                <cts:text xml:lang="en">cession</cts:text>
             </cts:word-query>
           </cts:near-query>

           -----
                (: few more options here:)
           -----
</options>
return search:search("", $searchOptions)

Response:

In response, the expected result after using the near-query is "2". However, 
the total count shown is "6".

<search:response snippet-format="src-snippet" total="6" start="1" 
page-length="10".......>
     <search:result index="1" uri="......
     ------
     ------
     </search:result>
     <search:result index="2" uri="......
     ------
     ------
     </search:result>
</search:response>

Regards,
Nachi


**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are 
not
to copy, disclose, or distribute this e-mail or its contents to any other 
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken
every reasonable precaution to minimize this risk, but is not liable for any 
damage
you may sustain as a result of any virus in this e-mail. You should carry out 
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this 
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to