Try our conversational search powered by Generative AI!

FIND query not giving consistent results



I am working on FIND 13.2.6. and CMS 11.20.5

I have written a scheduled jobs, in which I get pages from FIND, and put the results in a JSON file.

This is the below FIND query I have -

            var query = _searchClient.Service.Search<BasePage>();
            query = query

(AddRelevance is a custom filter I have created.)

I have 19000 matching records, and hence I am using paging to retrive the full set i.e 1000 results everytime until 19000 is reached.

But everytime I run this job, the results are inconsistent. For eg. if the article A and B come in the JSON first time, next time they are missing. The count of results remains the same i.e 19000 and the articles are present in FIND index, but they periodically disappear from the query results. 

Is there a limit to the query results? Or is it possible that somehow one of the FIND functions is causing inconsistent results? Any suggestions would be helpful!

Edited, Jun 03, 2021 9:08

First thing come to mind: you should apply order to make sure the paging you get everytime is consistent. 

Jun 03, 2021 11:15

Do you have multiple sites? Could issue be related to scheduled job context and the use of .FilterOnCurrentSite() ?

Aug 06, 2021 7:42

We do have multiple sites. But as Quan suggested, I added orderBy to the query, and haven't seen this issue come up since then!

Aug 06, 2021 7:58
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.