On Fri, Feb 27, 2015 at 3:35 AM, Nachiketa Kulkarni <
[email protected]> 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
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to