-
Notifications
You must be signed in to change notification settings - Fork 24.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
Mapper annotated text plugin highlighter crashes during text processing #39395
Comments
Pinging @elastic/es-search |
Thanks for raising this issue. I'll dig some deeper into why - my guess is it's some change in Lucene behaviour around the life cycles of Analyzers because the object that we null-pointer on is expected to be initialised as part of calls made during the analysis phase. |
This is a multi-threading issue. A single AnnotatedTextHighlighter object is shared across search threads but the search threads cause changes to its |
Thanks, waiting for v6.7. By the way, could you allow the user to escape the brackets in the annotated text field? Sometimes we do have non-omissible brackets appearing in our search text. |
Probably best to open another issue to track that. I imagine following whatever markdown syntax offers is the way forward on that |
Added thread safety by moving custom Analyzer object to per-request context rather than singleton. Added YAML test that reproduced the error. Closes elastic#39395
Bug fix for AnnotatedTextHighlighter. Added thread safety by moving parsed state to per-request context rather than holding in AnnotatedTextHighlighter singleton. Added YAML test that reproduced the error. Refactored to pull formatting logic from AnnotatedHighlighterAnalyzer into AnnotatedPassageFormatter Closes #39395
Bug fix for AnnotatedTextHighlighter - port of 39525 Relates to #39395
Bug fix for AnnotatedTextHighlighter - port of 39525 Relates to #39395
Bug fix for AnnotatedTextHighlighter - port of 39525 Relates to #39395
Fixed in 6.7 up |
Elasticsearch version: 6.5.4
Plugins installed: ["analysis-kuromoji", "ik-analyzer", "mapper-annotated-text"]
JVM version:
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
OS version:
Windows 10 Professional Ver 1803 Build 17134.590
Description of the problem including expected versus actual behavior:
@markharwood
The
annotated
highlighter in themapper-annotated-text
plugin crashes randomly when processing documents.Steps to reproduce:
annotated_text
field, then add some documents:The following search query will crash the
annotated
highlighter randomly. The number of returned items inhits.hits
can be fewer thanhits.total
in the query result:Provide logs (if relevant):
The highlighter throws
java.lang.NullPointerException
in two different lines:The text was updated successfully, but these errors were encountered: