Repository navigation
Translate search_after into a cursorMark built from the sort values - #181
Open
serhiy-bzhezytskyy wants to merge 3 commits into
Open
serhiy-bzhezytskyy wants to merge 3 commits into
serhiy-bzhezytskyy wants to merge 3 commits into
Conversation
A converted search_after kept its sort but lost the values, so the operation fetched the first page instead of the page after them. Solr starts a cursor at given sort values when the cursorMark encodes them: Base64 of the JavaBin list of one value per sort clause. The converter now builds that mark, appends id to the sort in the direction of the last clause, and adds a tie-break value that sorts after (asc) or before (desc) every id, so documents equal to the values are skipped as OpenSearch skips them. Only plong sort fields with non-negative values are carried; anything else is reported in CONVERTED.md.
A search that tells OpenSearch not to count, or to count up to a number, did the full exact count in Solr, which is more work than the search it is compared with. Solr's minExactCount reaches the same Lucene threshold: false becomes 1, which Lucene raises to the number of rows as OpenSearch's does, and a number is carried as it is. A search that does not state it keeps Solr's default.
# Conflicts: # solrorbit/conversion/workload_converter.py
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A converted
search_afterkept its sort but lost the values, so the operation fetched the first page instead of the page after them. Solr starts a cursor at given sort values when thecursorMarkencodes them: Base64 of the JavaBin list of one value per sort clause (CursorMark#getSerializedTotem).The converter now:
idto the sort in the direction of the last clause;asc) or before (desc) every id, so documents equal to the values are skipped as OpenSearch skips them.Only
plongsort fields with non-negative values are carried, the case compared with OpenSearch. Anything else is reported inCONVERTED.md.An explicit
track_total_hitsis carried asminExactCount:falsebecomes 1, the threshold OpenSearch hands Lucene, and a number is kept. A search that does not state it is unchanged.For geonames' three operations the converter now writes the bodies of apache/solr-orbit-workloads#32. On a 1,000,436-document sample, three consecutive pages of each give the same ids in the same order as OpenSearch's
search_after: 300, 212 (the whole result) and 300. The new tests fail without the change.