Page MenuHomePhabricator

Searches like "gro~s" cause Elasticsearch to barf back an error
Closed, ResolvedPublic

Description

Searches like "gro~s" cause Elasticsearch to barf back an error:

1 Warning:  Search backend error during full text search for 'gro~s'.  Error message is:  SearchPhaseExecutionException[Failed to execute phase [dfs], total failu

re; shardFailures {[nVH6MuLCT-Wprk3vavAs9Q][mediawikiwiki_general_red][0]: SearchParseException[[mediawikiwiki_general_red][0]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{"fields":["id","title","namespace","redirect"],"query":{"custom_score":{"script":"_score * log10(doc['links'].value + doc['redirect_links'].value + 2
)","query":{"query_string":{"query":"gro~s","fields":["title^20","heading^5","text","redirect.title^15"],"auto_generate_phrase_queries":true,"phrase_slop":3}}}},"highli
ght":{"pre_tags":["<span class=\"searchmatch\">"],"post_tags":["</span>"],"fields":{"title":{"number_of_fragments":0},"text":{"number_of_fragments":1},"redirect.title":
{"number_of_fragments":0},"heading":{"number_of_fragments":0}}},"suggest":{"text":"gro~s","phrase_title":{"phrase":{"field":"title.suggest","size":1,"max_errors":5,"con
fidence":2,"direct_generator":[{"f in /usr/local/apache/common-local/php-1.22wmf17/includes/debug/Debug.php on line 296

1 Warning:  Search backend error during full text search for 'gro~s'.  Error message is:  SearchPhaseExecutionException[Failed to execute phase [dfs], total failu

re; shardFailures {[nVH6MuLCT-Wprk3vavAs9Q][mediawikiwiki_content_black][2]: SearchParseException[[mediawikiwiki_content_black][2]: from[-1],size[-1]: Parse Failure [Fa
iled to parse source [{"fields":["id","title","namespace","redirect"],"query":{"custom_score":{"script":"_score * log10(doc['links'].value + doc['redirect_links'].value
+ 2)","query":{"query_string":{"query":"gro~s","fields":["title^20","heading^5","text","redirect.title^15"],"auto_generate_phrase_queries":true,"phrase_slop":3}}}},"hi
ghlight":{"pre_tags":["<span class=\"searchmatch\">"],"post_tags":["</span>"],"fields":{"title":{"number_of_fragments":0},"text":{"number_of_fragments":1},"redirect.tit
le":{"number_of_fragments":0},"heading":{"number_of_fragments":0}}},"suggest":{"text":"gro~s","phrase_title":{"phrase":{"field":"title.suggest","size":1,"max_errors":5,
"confidence":2,"direct_generator": in /usr/local/apache/common-local/php-1.22wmf17/includes/debug/Debug.php on line 296


Version: unspecified
Severity: normal

Details

Reference
bz54199

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:52 AM
bzimport added a project: CirrusSearch.
bzimport set Reference to bz54199.
bzimport added a subscriber: Unknown Object (MLST).

Change 84630 had a related patch set uploaded by Manybubbles:
Escape queries that use ~ incorrectly.

https://gerrit.wikimedia.org/r/84630

I'll push some automated tests for review in a bit.

Change 84630 merged by jenkins-bot:
Escape queries that use ~ incorrectly.

https://gerrit.wikimedia.org/r/84630