Gravatar for

Question by gminero, Jan 14, 2016 7:27 PM

Sort by date is not applied to complete result set

We are seeing a "sort by date" problem in Production as well as in our Test environment. It does not appear that the problem existed last week.

In the test environment when we select "All Content" there are 1,056,754 results returned. "All Content" is a combination of several sources.

When I sort by date, it only sorts the first 20 results instead of sorting by date on all the results. The most recent result, after sorting, is dated 2/13/2014 even though there are many results with a more current date.

If I select one of the other tabs (CSList which is a Web Crawler source), I get the same results. However, if I select one of the facets (sbc5x00), it filters for 'sbc5x00' results and the most recent result is from yesterday.

But if I select two facets (sbc5x00 and insight), I then get the same results as I did when selecting the "All Content" tab. It just happens that 'insight' results (HTML files) are the the most recently dated files on the CSList Web source based upon the script that created them. This script generates the files for the CSList source and runs nightly. But if I "touch" another set of HTML files (sessionmgrandapps), rebuild the source and then issue another query, then the sessionmgrandapps results appear as the most recent results even though they were actually created in 2012. The displayed date for these results, however, comes from a generated field, cslistdate, and is correct.

Shouldn't the CoveoSort class sort all results, not just the set of results displayed on a page ?

1 Reply
Gravatar for

Answer by Martin Laporte, Jan 17, 2016 7:29 PM

The CoveoSort component should indeed sort all the results. If fact it only tells the index to do so. So my first check would be the JSON requests going out to the index. Does it has the proper sort parameter? Is there any other param that might interfer with the results (additional filtering, etc…)?

Gravatar for

Comment by Jim Lynch, Jan 26, 2016 4:18 PM

What information from the REST query will help to determine whether there is an issue with the sort ?

In the REST query the cq is: @syssource==("Web - CSListMail") NOT @systitle==("Index of /cslistmail")" The sortCriteria is fielddescending and the sortField is @cslistdate"

Gravatar for

Comment by Martin Laporte, Jan 27, 2016 5:06 AM

Well that certainly looks OK. Can you check that @cslistdate is indeed a date field? Would it be possible to do a Fiddler trace of the problem happening and sending it to our support team so we can have a look at it?

Ask a question