Gravatar for

Question by mmccarthy, Mar 25, 2019 9:28 PM

Discrepancy/Duplicates and Facet document count

We have facets that contain a potentially small number of documents. We've noticed that when the documents in the index change, the search results update quickly, but there is some delay in the number of documents in the facet widget. For example, the search results show 8 documents but the facet says 14 documents. It's confusing to see the facet say 14 but only have 8 documents returned from the search. Is there some delay in when the document count on the facets is returned?


Gravatar for

Comment by Jean-François L'Heureux, Mar 26, 2019 1:34 PM

Is this your use case or it is something different?

Before index update: A blank query shows 14 count for a facet item. You do not select that facet item.

After index update: The same blank query still shows 14 count for the facet item. You select that facet item and only 8 search results are returned.

This could be caused by the Coveo Search API query/result cache built-in Coveo Cloud. Each query is cached for 15 minutes. The cache key contains the query including the selected facet items. If you do the same blank query before and after an index update, but within 15 minutes, the search results and facet count of that second query will not change. You will get the cached search results. If before the index update, you did not click on the facet item, this query is not in the cache, so when you click on the facet item after the index update, it returns fresh results.

0 Reply
Ask a question