-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new parameter, max_analyzer_offset, for the highlighter (#3893)
* #3842 adds a new parameter to the highlighter, the max_analyzer_offset. When this parameter is provided the highlight stops in its value. This prevents the highlighter to go beyond the index maxAnalyzedOffset. Signed-off-by: Hauck <joaoh14@gmail.com> * Adds a test for the new parameter Signed-off-by: Hauck <joaoh14@gmail.com> * Fix the test add in the previous commit; Signed-off-by: Hauck <joaoh14@gmail.com> * This was checking against the wrong field Signed-off-by: Hauck <joaoh14@gmail.com> * Only runs the test for the correct version Signed-off-by: Hauck <joaoh14@gmail.com> * Skips the test in Elasticsearch as well; Signed-off-by: Hauck <joaoh14@gmail.com> * Remove elastic 3.0 to test Signed-off-by: Hauck <joaoh14@gmail.com> * Skips all versions Signed-off-by: Hauck <joaoh14@gmail.com> * Remove unnecessary fields as pointed by @reta Signed-off-by: Hauck <joaoh14@gmail.com> * Compute if fieldMaxAnalyzedIsNotValid in the constructor as suggest by @reta Signed-off-by: Hauck <joaoh14@gmail.com> * As discussed, it is better to throws different exceptions for when the fieldMaxAnalyzed is not valid and for when it is disabled; Signed-off-by: Hauck <joaoh14@gmail.com> * hint what to do to allow highlight of bigger documents Signed-off-by: Hauck <joaoh14@gmail.com> * Let the user define the new parameter globally for all fields highlighted Signed-off-by: Hauck <joaoh14@gmail.com> * Change the fieldMaxAnalyzedOffset Integer in order to use null when it is absent in highlight. This allows the error messages to much more precise, showing invalid for all negative numbers; Signed-off-by: Hauck <joaoh14@gmail.com> * Update javadocs and implements the stream methods for the new fields; Signed-off-by: Hauck <joaoh14@gmail.com> * builder.field do not accept null, so check before calling the method is necessary Signed-off-by: Hauck <joaoh14@gmail.com> * Only send and read the new fields if the version supports it Signed-off-by: Hauck <joaoh14@gmail.com> * the previous commit was checking the wrong field Signed-off-by: Hauck <joaoh14@gmail.com> * Check for version 3.0.0 instead of current version Signed-off-by: Hauck <joaoh14@gmail.com> * Update server/src/main/java/org/apache/lucene/search/uhighlight/CustomUnifiedHighlighter.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Hauck <joaoh14@gmail.com> * Execute the test after version 3.0.0 Signed-off-by: Hauck <joaoh14@gmail.com> Co-authored-by: Andriy Redko <drreta@gmail.com> (cherry picked from commit 931813f)
- Loading branch information
1 parent
c0b1b59
commit 14bf6a7
Showing
8 changed files
with
117 additions
and
8 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
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