Not a bug Shard error when user searches for query with exclamation

Alpha1

Well-known member
Affected version
1.5.21
Error Info
XenForo_Exception: Elasticsearch error: {"root_cause":[{"type":"query_shard_exception","reason":"Failed to parse query [something!]","index_uuid":"c_4XWVyuTfu6iieJc9XXkg","index":"df1"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"df1","node":"wHYi6XWVSaqmFUljnv4Z5g","reason":{"type":"query_shard_exception","reason":"Failed to parse query [something!]","index_uuid":"c_4XWVyuTfu6iieJc9XXkg","index":"df1","caused_by":{"type":"parse_exception","reason":"Cannot parse 'something!': Encountered \"<EOF>\" at line 1, column 9.\nWas expecting one of:\n <BAREOPER> ...\n \"(\" ...\n \"*\" ...\n <QUOTED> ...\n <TERM> ...\n <PREFIXTERM> ...\n <WILDTERM> ...\n <REGEXPTERM> ...\n \"[\" ...\n \"{\" ...\n <NUMBER> ...\n <TERM> ...\n \"*\" ...\n ","caused_by":{"type":"parse_exception","reason":"Encountered \"<EOF>\" at line 1, column 9.\nWas expecting one of:\n <BAREOPER> ...\n \"(\" ...\n \"*\" ...\n <QUOTED> ...\n <TERM> ...\n <PREFIXTERM> ...\n <WILDTERM> ...\n <REGEXPTERM> ...\n \"[\" ...\n \"{\" ...\n <NUMBER> ...\n <TERM> ...\n \"*\" ...\n "}}}}]} DSL:{"query":{"function_score":{"boost_mode":"replace","query":{"bool":{"must":[{"query_string":{"query":"something!","fields":["title^3","message"],"default_operator":"and"}}],"must_not":[{"exists":{"field":"hidden"}}],"filter":[{"terms":{"node":[50,20]}},{"terms":{"type":["post","thread"]}}]}},"script_score":{"script":{"params":{"now":1536099674,"halflife":5184000},"lang":"painless","source":"_score \/ Math.pow(2.0F, Math.min(10.0F * params.halflife, Math.abs(params.now - doc['date'].value)) \/ params.halflife)"}}}},"sort":[{"_score":"desc"},{"date":"desc"}],"size":200,"docvalue_fields":["discussion_id","user","date"],"_source":false} - library/XenES/Search/SourceHandler/ElasticSearch.php:1052
Generated By: Kr1234, Tuesday at 11:21 PM

Stack Trace
#0 /library/XenES/Search/SourceHandler/ElasticSearch.php(391): XenES_Search_SourceHandler_ElasticSearch->_logSearchResponseError(Object(stdClass), true)
#1 /library/SV/SearchImprovements/XenES/Search/SourceHandler/ElasticSearch.php(11): XenES_Search_SourceHandler_ElasticSearch->executeSearch('something!', false, Array, Array, '', 200, Object(SV_ElasticEss_XenForo_Search_DataHandler_Post))
#2 /library/XenForo/Search/SourceHandler/Abstract.php(151): SV_SearchImprovements_XenES_Search_SourceHandler_ElasticSearch->executeSearch('something!', false, Array, Array, '', '200', Object(SV_ElasticEss_XenForo_Search_DataHandler_Post))
#3 /library/XenForo/Search/Searcher.php(110): XenForo_Search_SourceHandler_Abstract->searchType(Object(SV_ElasticEss_XenForo_Search_DataHandler_Post), 'something!', Array, 'relevance', 0, '200')
#4 /library/XenForo/ControllerPublic/Search.php(246): XenForo_Search_Searcher->searchType(Object(SV_ElasticEss_XenForo_Search_DataHandler_Post), 'something!', Array, 'relevance', 0)
#5 /library/XenES/Proxy/ControllerSearch.php(34): XenForo_ControllerPublic_Search->actionSearch()
#6 /library/SV/SearchImprovements/XenForo/ControllerPublic/Search.php(46): XenES_Proxy_ControllerSearch->actionSearch()
#7 /library/SV/OptimizedListQueries/XenForo/ControllerPublic/Search.php(9): SV_SearchImprovements_XenForo_ControllerPublic_Search->actionSearch()
#8 /library/SV/WordCountSearch/XenForo/ControllerPublic/Search.php(50): SV_OptimizedListQueries_XenForo_ControllerPublic_Search->actionSearch()
#9 /library/SV/ElasticEss/XenForo/ControllerPublic/Search.php(441): SV_WordCountSearch_XenForo_ControllerPublic_Search->actionSearch()
#10 /library/XenForo/FrontController.php(369): SV_ElasticEss_XenForo_ControllerPublic_Search->actionSearch()
#11 /library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#12 /index.php(13): XenForo_FrontController->run()
#13 {main}
Request State
array(3) {
["url"] => string(37) "https://mys-forum.com/search/search"
["_GET"] => array(1) {
["/search/search"] => string(0) ""
}
["_POST"] => array(7) {
["keywords"] => string(9) "something!"
["users"] => string(0) ""
["date"] => string(0) ""
["word_count"] => array(1) {
["lower"] => string(0) ""
}
["nodes"] => array(1) {
[0] => string(2) "50"
}
["type"] => array(1) {
["post"] => array(1) {
["child_nodes"] => string(1) "1"
}
}
["_xfToken"] => string(8) "********"
}
}
 
The query_string bit is stock XenForo, but the "!" should be stripped.

My Enhanced Search Improvements add-on can manipulate the output of parseQuery but it replaces query_string with simple_query_string when it does that.

Perhaps some old code edits to SPLIT_CHAR_RANGES ? Or just an out of date version of XFES.
 
Can you confirm the version of XFES (and whether there are any other add-ons that touch search) and what version of Elasticsearch you're using?
 
Top Bottom