Hi,
In elasticsearch 7.9.2 - when a lot of documents are highlighted by unified highlighter - I am getting an exception. The query used to work in elasticsearch 7.1.0.
I try to highlight everything:
"highlight": {
"type": "unified",
"fields": {
"*": {}
}
}
And the query contains over 1000 terms.
Exception trace is:
{"type": "server", "timestamp": "2020-11-11T16:44:07,751Z", "level": "WARN", "component": "r.suppressed", "cluster.name": "gds_cluster", "node.name": "gds_es1", "message": "path: /gds_statement/_search, params: {pretty=true, index=gds_statement}", "cluster.uuid": "7sKq2JtDQk62RH6daFszYw", "node.id": "3s2LJmVDTdibsiSUBiu2xw" ,
"stacktrace": ["org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:551) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:309) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:582) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:393) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.access$100(AbstractSearchAsyncAction.java:68) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:245) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:73) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:59) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:403) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TransportService$6.handleException(TransportService.java:638) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1172) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1281) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1255) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:61) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.transport.TransportChannel.sendErrorResponse(TransportChannel.java:56) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:51) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService.lambda$runAsync$0(SearchService.java:414) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737) [elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.9.2.jar:7.9.2]",
"at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]",
"at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]",
"at java.lang.Thread.run(Thread.java:832) [?:?]",
"Caused by: org.elasticsearch.ElasticsearchException$1: bytes can be at most 32766 in length; got 37636",
"at org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:644) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:307) [elasticsearch-7.9.2.jar:7.9.2]",
"... 21 more",
"Caused by: org.apache.lucene.util.BytesRefHash$MaxBytesLengthExceededException: bytes can be at most 32766 in length; got 37636",
"at org.apache.lucene.util.BytesRefHash.add(BytesRefHash.java:270) ~[lucene-core-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:53:36]",
"at org.apache.lucene.search.uhighlight.PassageScorer.score(PassageScorer.java:127) ~[lucene-highlighter-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.apache.lucene.search.uhighlight.CustomFieldHighlighter.maybeAddPassage(CustomFieldHighlighter.java:149) ~[elasticsearch-7.9.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.apache.lucene.search.uhighlight.CustomFieldHighlighter.highlightOffsetsEnums(CustomFieldHighlighter.java:134) ~[elasticsearch-7.9.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.apache.lucene.search.uhighlight.FieldHighlighter.highlightFieldForDoc(FieldHighlighter.java:79) ~[lucene-highlighter-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.apache.lucene.search.uhighlight.UnifiedHighlighter.highlightFieldsAsObjects(UnifiedHighlighter.java:641) ~[lucene-highlighter-8.6.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.apache.lucene.search.uhighlight.CustomUnifiedHighlighter.highlightField(CustomUnifiedHighlighter.java:101) ~[elasticsearch-7.9.2.jar:8.6.2 016993b65e393b58246d54e8ddda9f56a453eb0e - ivera - 2020-08-26 10:54:38]",
"at org.elasticsearch.search.fetch.subphase.highlight.UnifiedHighlighter.highlight(UnifiedHighlighter.java:131) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.fetch.subphase.highlight.HighlightPhase.hitExecute(HighlightPhase.java:117) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.fetch.subphase.highlight.HighlightPhase.hitExecute(HighlightPhase.java:50) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:180) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:464) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:444) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService.access$200(SearchService.java:136) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService$2.lambda$onResponse$0(SearchService.java:396) ~[elasticsearch-7.9.2.jar:7.9.2]",
"at org.elasticsearch.search.SearchService.lambda$runAsync$0(SearchService.java:412) ~[elasticsearch-7.9.2.jar:7.9.2]",
"... 6 more"] }