-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix position increment gap on phrase/prefix analyzers (#70096)
Custom position increments are handled by wrapping analyzers with a NamedAnalyzer and passing the custom increment through to its constructor. However, phrase and prefix analyzers use delegating analyzer wrappers to add extra filtering to their parent analyzers, and we can't wrap analyzers multiple times because this wrecks reuse strategies, so we unwrap the parent before passing it to phrase and prefix builders. This unwrapping means that we lose the custom position increments; in particular, it means that we can end up with a position increment gap of -1, which is the sentinel value for the unset parameter - and that means exceptions at index time for backwards-moving positions on fields with multiple values. This commit removes the sentinel value and uses standard parameter defaults and the isConfigured() method instead, plus it adds some more comprehensive testing for position increments when combined with phrase/prefix index options on text fields. Fixes #70049
- Loading branch information
1 parent
e7ad8c3
commit 6fd96d1
Showing
4 changed files
with
63 additions
and
9 deletions.
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