Re: [MarkLogic Dev General] search result mismatch

2015-02-27 Thread Christopher Hamlin
On Fri, Feb 27, 2015 at 3:35 AM, Nachiketa Kulkarni <
nachiketa_kulka...@infosys.com> wrote:

>  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.
>

To expand a bit on Geert's answer, 'total' is an estimate using only
information in the indexes.  The search results are normally filtered to
ensure accuracy, though you have control over that.

If the search based on indexes is completely accurate then the estimate is
correct.  When you add the near query, MarkLogic needs position information
in the indexes for the estimate to be accurate.  If you do not have that
information in the indexes then the estimate counts any document that
_could_ match, ignoring the near constraint.  The filtered search will
still be correct, discarding any false positives since it has the document
and can calculate the distance to see if the document matches the near
query.

See also:  http://docs.marklogic.com/guide/search-dev/search-api#id_98851
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] search result mismatch

2015-02-27 Thread Geert Josten
Hi Nachi,

Sounds like you are doing an unfiltered search, or haven’t enable positions to 
allow to accurately resolve the near-query. For a near-query on words you would 
be looking for the word positions setting of the database..

Kind regards,
Geert

From: Nachiketa Kulkarni 
mailto:nachiketa_kulka...@infosys.com>>
Reply-To: MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Friday, February 27, 2015 at 9:35 AM
To: "general@developer.marklogic.com<mailto:general@developer.marklogic.com>" 
mailto:general@developer.marklogic.com>>
Subject: [MarkLogic Dev General] search result mismatch

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 :=
http://marklogic.com/appservices/search";>
  false
  score-logtfidf
  
case-insensitive
diacritic-insensitive
punctuation-insensitive
  
-
-
   
   http://marklogic.com/cts>
  
   -
(: few options here:)
   -
  
   http://marklogic.com/cts";>
 
 fonds commerce
 
 
cession
 
   

   -
(: few more options here:)
   -

return search:search(“”, $searchOptions)

Response:

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


 
 


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


[MarkLogic Dev General] search result mismatch

2015-02-27 Thread Nachiketa Kulkarni
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 :=
http://marklogic.com/appservices/search";>
  false
  score-logtfidf
  
case-insensitive
diacritic-insensitive
punctuation-insensitive
  
-
-
   
   http://marklogic.com/cts>
  
   -
(: few options here:)
   -
  
   http://marklogic.com/cts";>
 
 fonds commerce
 
 
cession
 
   

   -
(: few more options here:)
   -

return search:search("", $searchOptions)

Response:

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


 http://developer.marklogic.com/mailman/listinfo/general