Skip to content
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 search #39686

Closed
mindis opened this issue Mar 5, 2019 · 3 comments
Closed

Mapper annotated text plugin highlighter crashes during search #39686

mindis opened this issue Mar 5, 2019 · 3 comments

Comments

@mindis
Copy link

mindis commented Mar 5, 2019

Describe the feature:

Elasticsearch version (bin/elasticsearch --version):
6.5.4

Plugins installed: ["mapper-annotated-text"]

JVM version (java -version):
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

OS version (uname -a if on a Unix-like system):
Centos 7.3 3.10.0-514.26.2.el7.x86_64

Description of the problem including expected versus actual behavior:

@markharwood
Mapper annotated text plugin highlighter crashes during search

Steps to reproduce:

PUT /index
{
  "mappings": {
    "_doc": {
      "properties": {
        "my_field": {
          "type": "annotated_text"
        }
      }
    }
  }
}

PUT /index/_doc/1
{
  "my_field": "[Jeff Beck](Beck) plays a strat"
}

PUT /index/_doc/2
{
  "my_field": "[Kimchy](Beck) plays a strat"
}

POST /index/_search
{
  "query": {
    "term": {
        "my_field": "Beck" 
    }
  },
  "highlight": {
    "fields": {
      "my_field": {
        "type": "annotated", 
        "require_field_match": false
      }
    }
  }
}

Provide logs (if relevant):

[2019-03-05T09:31:36,948][INFO ][o.e.c.r.a.AllocationService] [sG6dzX0] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[rat][0]] ...]).
[2019-03-05T09:34:57,812][DEBUG][o.e.a.s.TransportSearchAction] [sG6dzX0] [14] Failed to execute fetch phase
org.elasticsearch.transport.RemoteTransportException: [sG6dzX0][10.128.24.65:9300][indices:data/read/search[phase/fetch/id]]
Caused by: java.lang.NullPointerException
at org.elasticsearch.index.mapper.annotatedtext.AnnotatedTextFieldMapper$AnnotatedHighlighterAnalyzer.getPlainTextValuesForHighlighter(Annota tedTextFieldMapper.java:337) ~[?:?]
at org.elasticsearch.search.fetch.subphase.highlight.AnnotatedTextHighlighter.loadFieldValues(AnnotatedTextHighlighter.java:55) ~[?:?]
at org.elasticsearch.search.fetch.subphase.highlight.UnifiedHighlighter.highlight(UnifiedHighlighter.java:74) ~[elasticsearch-6.5.4.jar:6.5.4 ]
at org.elasticsearch.search.fetch.subphase.highlight.HighlightPhase.hitExecute(HighlightPhase.java:110) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:159) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.search.SearchService.lambda$executeFetchPhase$3(SearchService.java:556) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.search.SearchService$3.doRun(SearchService.java:361) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:723) [elasticsearch-6.5. 4.jar:6.5.4]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.5.4.jar:6.5.4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

@markharwood
Copy link
Contributor

Thanks for reporting this. It looks to be a duplicate of #39395 which I'm currently fixing.
It's a thread safety issue so a possible workaround should be to work with one shard only.

Closing as a duplicate

@mindis
Copy link
Author

mindis commented Mar 5, 2019

thanks, just wanted to make sure this is same issue.

@mindis
Copy link
Author

mindis commented Mar 5, 2019

and yes using index with single shard doesn't crash

PUT /index

{  "mappings": {
    "_doc": {
      "properties": {
        "my_field": {
          "type": "annotated_text"
        }
      }
    }
  },
    "settings" : {
        "index" : {
            "number_of_shards" : 1, 
            "number_of_replicas" : 1 
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants