Page MenuHomePhabricator

The experimental highlighter fails with common terms query
Open, LowPublic

Description

The hightlighter seems to have specific code to handle CommonTermsQuery but it does not work:

org.elasticsearch.search.fetch.FetchPhaseExecutionException: [cirrustestwiki_content_1438190225][0]: query[filtered(((all.plain:prefix | all:prefix^0.5) all_near_match:prefix)~1)->cache(_type:page)],from[0],size[20]: Fetch Failed [Failed to highlight field [title]]
	at org.elasticsearch.search.highlight.ExperimentalHighlighter.highlight(ExperimentalHighlighter.java:92)
	at org.elasticsearch.search.highlight.HighlightPhase.hitExecute(HighlightPhase.java:133)
	at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:194)
	at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:516)
	at org.elasticsearch.search.action.SearchServiceTransportAction$17.call(SearchServiceTransportAction.java:452)
	at org.elasticsearch.search.action.SearchServiceTransportAction$17.call(SearchServiceTransportAction.java:449)
	at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.apache.lucene.search.TermQuery cannot be cast to org.apache.lucene.search.BooleanQuery
	at org.wikimedia.highlighter.experimental.lucene.QueryFlattener.flattenQuery(QueryFlattener.java:401)
	at org.wikimedia.highlighter.experimental.lucene.QueryFlattener.flatten(QueryFlattener.java:145)
	at org.wikimedia.highlighter.experimental.lucene.QueryFlattener.flattenQuery(QueryFlattener.java:214)
	at org.wikimedia.highlighter.experimental.lucene.QueryFlattener.flatten(QueryFlattener.java:123)
	at org.wikimedia.highlighter.experimental.lucene.QueryFlattener.flatten(QueryFlattener.java:103)
	at org.wikimedia.highlighter.experimental.lucene.hit.weight.BasicQueryWeigher.<init>(BasicQueryWeigher.java:46)
	at org.elasticsearch.search.highlight.ExperimentalHighlighter$HighlightExecutionContext.ensureWeigher(ExperimentalHighlighter.java:286)
	at org.elasticsearch.search.highlight.ExperimentalHighlighter$HighlightExecutionContext.highlight(ExperimentalHighlighter.java:177)
	at org.elasticsearch.search.highlight.ExperimentalHighlighter.highlight(ExperimentalHighlighter.java:86)
	... 9 more

Event Timeline

dcausse created this task.Sep 16 2015, 12:44 PM
dcausse raised the priority of this task from to Needs Triage.
dcausse updated the task description. (Show Details)
dcausse added a subscriber: dcausse.
Restricted Application added a project: Discovery. · View Herald TranscriptSep 16 2015, 12:44 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
dcausse moved this task from Needs triage to Search on the Discovery board.Sep 16 2015, 4:48 PM
dcausse set Security to None.

@dcausse Do you recommend pulling this into the sprint?

No, I think the fix is pretty easy and the workaround we use is maybe better. This is just a reminder for when I'll have time, it should not take more than 2/3 hours.

No, I think the fix is pretty easy and the workaround we use is maybe better. This is just a reminder for when I'll have time, it should not take more than 2/3 hours.

Great. Thanks!

Deskana triaged this task as Low priority.Sep 17 2015, 5:55 PM