Gravatar for

Question by cmgutmanis, Apr 22, 2015 8:51 PM

ResultsTotalCount different than actual collection size returned


I am using the SOAP api to query a Sitecore index and I am getting occasional discrepancies between the ResultsTotalCount on the return object and the actual size of the result collection returned; i.e. ResultsTotalCount will indicate I have 13 matches, but only 12 results come back from my query. In addition, when I run the exact same query through the Coveo Admin Tool, I receive the correct result set. I have looked at the item that is missing from my sitecore call and nothing immediately jumps out at me as a possible reason for its omission - the item is not a duplicate result, and it has been published through normal workflow. Is there some other field, either in Sitecore or in Coveo that would give any indication as to why this item is excluded?

Thank you very much in advance for any help on this issue!

1 Reply
Gravatar for

Answer by Martin Laporte, Apr 23, 2015 4:08 AM

The duplicate filtering feature can have this effect, but when this happens the TotalCount will go down as results are filtered. One easy way to check this is to request a large number of results. In your case, if you were to request 100 results and receive only 12, the TotalCount should be 12, but if you request only 1 it should be 13. Is that the case?

(duplicates a checked for results that are truly returned for performance reasons).

Gravatar for

Comment by Luc Bergeron, Apr 23, 2015 8:41 AM

Can you validate if there are many languages/versions for the same item? Coveo for Sitecore indexes every language/version of an item as a separate document. In the Index Browser, you will see that the document URL changes depending on that.

Also, you can check the search index query logs to see the exact query that has been processed. It might help find the difference between the query performed through the API versus the Admin Tool. In the Admin Tool (Logs > Queries). You can also check the log file directly. Default location is C:\CES7\Index\Default\Log\Queries_*.log.

Hope this helps

Gravatar for

Comment by cmgutmanis, Apr 23, 2015 10:00 AM

@mlaporte, unfortunately no, this is not the issue. In this case, I am requesting 25 results initially. The TotalCount in this case is 13, but I only receive 12 results.

Gravatar for

Comment by Martin Laporte, Apr 23, 2015 10:03 AM

Are you specifying a value for CustomFilter in your SOAP query?

Gravatar for

Comment by cmgutmanis, Apr 23, 2015 11:44 AM

@mlaporte, No, I don't have any CustomFilters set. I explicitly changed the CustomFilterRange value to match what goes through when I make the query through a Coveo Search Page.

Gravatar for

Comment by cmgutmanis, Apr 23, 2015 11:47 AM

@lbergeron, no, I don't think this is the issue. The missing document from my search results is definitely a distinct item, not an older/newer version or a translation of an existing page.

Gravatar for

Comment by Martin Laporte, Apr 24, 2015 3:41 AM

One thing I forgot, does the TotalCountFiltered returns the correct value (12) ?

Ask a question