-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Not A Bug
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Core MongoDB
-
Tags:
-
Backlog priority:800
-
Sprint:nxplatform next
-
Story Points:2
According to MongoDB documentation the order set by $in clause is not always respected in the result.
This can lead to response with a different order than the one submitted in an NXQL IN clause when the query has no sort option and performed against DBS (MongoDB) backend.
So far there is no known bug related to this behavior, because code is explicitly using sort option when ordering is necessary.
This is something that we need to keep in mind but no action is required before observing a real problem.
Contrary to what was initially written, this cannot be the cause of a wrong ordered when using an Elastic search because when documents are fetched from DBS because they're post sorted to follow the elastic response ordering.
--------
Previous wrong description (for the record)
Observed problem: Sometimes when a PP uses ES, the result order returned from ES does not match what is shown in the UI.
- The VcsFetcher is loading the docs ids returned by elastic from the backend using a NXQL query SELECT * from document WHERE ecm:uuid IN (<ordered list of ids>).
- It has been observed that running this NXQL query against MongoDB does not always return the documents in the order of the $in clause, as confirmed by this post https://stackoverflow.com/questions/22797768/does-mongodbs-in-clause-guarantee-order#22800784
Expected behavior: Nuxeo should force the order of the documents by sorting them according to the order of the list of ids provided to the IN clause
- is related to
-
NXP-32103 Elastic PageProvider returns unsorted results when using manageAlias
- Resolved