-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Backport 2.x] Adds a new parameter, max_analyzer_offset, for the highlighter #4031
Merged
reta
merged 2 commits into
opensearch-project:2.x
from
hauck-jvsh:backport/backport-3893-to-2.x
Jul 28, 2022
Merged
[Backport 2.x] Adds a new parameter, max_analyzer_offset, for the highlighter #4031
reta
merged 2 commits into
opensearch-project:2.x
from
hauck-jvsh:backport/backport-3893-to-2.x
Jul 28, 2022
Conversation
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
…earch-project#3893) * opensearch-project#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 <[email protected]> * Adds a test for the new parameter Signed-off-by: Hauck <[email protected]> * Fix the test add in the previous commit; Signed-off-by: Hauck <[email protected]> * This was checking against the wrong field Signed-off-by: Hauck <[email protected]> * Only runs the test for the correct version Signed-off-by: Hauck <[email protected]> * Skips the test in Elasticsearch as well; Signed-off-by: Hauck <[email protected]> * Remove elastic 3.0 to test Signed-off-by: Hauck <[email protected]> * Skips all versions Signed-off-by: Hauck <[email protected]> * Remove unnecessary fields as pointed by @reta Signed-off-by: Hauck <[email protected]> * Compute if fieldMaxAnalyzedIsNotValid in the constructor as suggest by @reta Signed-off-by: Hauck <[email protected]> * 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 <[email protected]> * hint what to do to allow highlight of bigger documents Signed-off-by: Hauck <[email protected]> * Let the user define the new parameter globally for all fields highlighted Signed-off-by: Hauck <[email protected]> * 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 <[email protected]> * Update javadocs and implements the stream methods for the new fields; Signed-off-by: Hauck <[email protected]> * builder.field do not accept null, so check before calling the method is necessary Signed-off-by: Hauck <[email protected]> * Only send and read the new fields if the version supports it Signed-off-by: Hauck <[email protected]> * the previous commit was checking the wrong field Signed-off-by: Hauck <[email protected]> * Check for version 3.0.0 instead of current version Signed-off-by: Hauck <[email protected]> * Update server/src/main/java/org/apache/lucene/search/uhighlight/CustomUnifiedHighlighter.java Co-authored-by: Andriy Redko <[email protected]> Signed-off-by: Hauck <[email protected]> * Execute the test after version 3.0.0 Signed-off-by: Hauck <[email protected]> Co-authored-by: Andriy Redko <[email protected]> (cherry picked from commit 931813f) Signed-off-by: Hauck <[email protected]>
Signed-off-by: Hauck <[email protected]>
reta
reviewed
Jul 28, 2022
...src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java
Show resolved
Hide resolved
reta
approved these changes
Jul 28, 2022
Gradle Check (Jenkins) Run Completed with:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #4031 +/- ##
============================================
- Coverage 70.68% 70.51% -0.18%
+ Complexity 56489 56430 -59
============================================
Files 4527 4527
Lines 271761 271794 +33
Branches 39975 39983 +8
============================================
- Hits 192092 191647 -445
- Misses 63513 64062 +549
+ Partials 16156 16085 -71 ☔ View full report in Codecov by Sentry. |
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.
I was not able to edit the original pull request so I open another one