-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for index sorting with document blocks #12829
Merged
Merged
Changes from 34 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
193d87a
first cut at sorting only the parent documents
s1monw f5eb4f8
progress
s1monw f3b90c0
add validator
s1monw 97b35e0
tidy
s1monw b65eda0
fix tests
s1monw 191ebaf
remove dead code
s1monw 345edc5
add more tests
s1monw 1693953
tidy
s1monw baaedcd
add test for validations
s1monw 2162cce
add test for validations
s1monw 56a4444
fix imports
s1monw ff8144a
apply feedback
s1monw ab4b3bc
remove dead code
s1monw 224c7df
fix comparison
s1monw 86d7032
add bwc
s1monw 5a15f58
add test for BWC
s1monw 0431a51
fix test
s1monw 3e64766
improve BWC testing
s1monw 5f6c297
address concerns about field comparison
s1monw 6e64b51
cleanup
s1monw e31f17f
apply feedback
s1monw 4b33f85
Move parent field to IWC and FieldInfos
s1monw f26646b
respect version in file format
s1monw 2a14c41
tidy
s1monw 76d4ba2
tidy
s1monw 227c3cf
tidy
s1monw ac81019
move test
s1monw 7573c0a
add test if field is already used
s1monw 3781c86
add javadocs
s1monw cc17352
tidy
s1monw 7087f2c
add import
s1monw c122994
remove hard checks for same soft deletes field
s1monw a73e52b
apply feedback
s1monw 2635711
Merge branch 'main' into parent_field
s1monw 502703e
apply feedback
s1monw 6f11436
beef up testing and revert to -1 as a default value isntead of the nu…
s1monw e2876da
Merge branch 'main' into parent_field
s1monw 023d242
add changes
s1monw d36dde5
fix polishing comments
s1monw 4c6e152
add test for single doc blocks don't trigger hasBlocks
s1monw ff8f561
remove extra whitespace in error msg
s1monw 0334d25
remove extra whitespace in error msg
s1monw 25e6da4
add test and docs to make mike not staring at this forever
s1monw 363ce3d
apply review comments
s1monw 4e829cf
fix test
s1monw a4b91b5
Merge branch 'main' into parent_field
s1monw 2980f57
change wording
s1monw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,7 +197,13 @@ public SegmentInfo read( | |
sortField[i] = SortFieldProvider.forName(provider).readSortField(bytes); | ||
assert bytes.eof(); | ||
} | ||
Sort indexSort = sortField.length == 0 ? null : new Sort(sortField); | ||
|
||
final Sort indexSort; | ||
if (sortField.length == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Die ternary operator die! |
||
indexSort = null; | ||
} else { | ||
indexSort = new Sort(sortField); | ||
} | ||
|
||
SimpleTextUtil.checkFooter(input); | ||
|
||
|
@@ -336,7 +342,6 @@ public void write(Directory dir, SegmentInfo si, IOContext ioContext) throws IOE | |
SimpleTextUtil.write(output, b.bytes.get().toString(), scratch); | ||
SimpleTextUtil.writeNewline(output); | ||
} | ||
|
||
SimpleTextUtil.writeChecksum(output, scratch); | ||
} | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing indexing doc blocks into an old (pre-10.0) index right? In this case does IW still add the DV field to the parent doc? The test here seems not to be configuring a parent field, so I guess no? Only indices created 10.0+ will do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, unless we 1. backport this which is possible and 2. if you set a parent field in the old index. yet I can't fully test that just yet since it's not backported. makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this makes sense -- if you have a pre-10.0 index, then none of the new code is run. You must create a new index to get the stronger checking.
(Or, 9.10.x index if we backport).