Enhanced search breaks when excluding Wiki content-types.
Our search stopped working recently, I tracked the error down to having disabled some types under "Exclude content-types from generic search results"
Code:
XFES\Elasticsearch\RequestException: Elasticsearch error: [21:29] [terms_lookup] unknown field [21] DSL:{"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":"100","query":{"bool":{"must_not":[{"terms":{"vwtype":{"21":21,"29":29,"32":32}}},{"term":{"node":68}}],"must":[{"function_score":{"query":{"simple_query_string":{"query":"test","fields":["title","message"],"default_operator":"and"}},"functions":[{"exp":{"date":{"origin":1667283118,"decay":0.5,"scale":31536000}}}]}}]}}} src/addons/XFES/Elasticsearch/Api.php:410
Generated by: mazzly Nov 1, 2022 at 8:11 AM
Stack trace
#0 src/addons/XFES/Elasticsearch/Api.php(331): XFES\Elasticsearch\Api->request('get', 'ttfcluster/_sea...', '{
"sort": [...')
#1 src/addons/XFES/Elasticsearch/Api.php(234): XFES\Elasticsearch\Api->requestFromIndex('get', '_search', Array)
#2 src/addons/SV/SearchImprovements/XFES/Elasticsearch/Api.php(33): XFES\Elasticsearch\Api->search(Array)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(748): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#4 src/addons/XFES/Search/Source/Elasticsearch.php(144): XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array, '100')
#5 src/XF/Search/Search.php(183): XFES\Search\Source\Elasticsearch->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '100')
#6 src/XF/Search/Search.php(212): XF\Search\Search->XF\Search\{closure}(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '100')
#7 src/XF/Search/Search.php(179): XF\Search\Search->executeSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '100', Object(Closure), true)
#8 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery))
#9 src/XF/Pub/Controller/Search.php(430): XF\Repository\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array, true)
#10 src/XF/Pub/Controller/Search.php(117): XF\Pub\Controller\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array)
#11 src/addons/SV/SearchImprovements/XF/Pub/Controller/Search.php(71): XF\Pub\Controller\Search->actionSearch()
#12 src/XF/Mvc/Dispatcher.php(350): SV\SearchImprovements\XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), NULL)
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), NULL)
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#17 src/XF.php(488): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
Request state
array(4) {
["url"] => string(14) "/search/search"
["referrer"] => string(32) "https://www.....com/"
["_GET"] => array(1) {
["/search/search"] => string(0) ""
}
["_POST"] => array(3) {
["keywords"] => string(4) "test"
["c"] => array(1) {
["users"] => string(0) ""
}
["_xfToken"] => string(8) "********"
}
}
I saw there was a thread about "search improvements" addon breaking things, so I tried disabling that also, but still problem:
Code:
XFES\Elasticsearch\RequestException: Elasticsearch error: [21:29] [terms_lookup] unknown field [21] src/addons/XFES/Elasticsearch/Api.php:410
Generated by: mazzly Nov 1, 2022 at 8:41 AM
Stack trace
#0 src/addons/XFES/Elasticsearch/Api.php(331): XFES\Elasticsearch\Api->request('get', 'ttfcluster/_sea...', '{
"sort": [...')
#1 src/addons/XFES/Elasticsearch/Api.php(234): XFES\Elasticsearch\Api->requestFromIndex('get', '_search', Array)
#2 src/addons/XFES/Search/Source/Elasticsearch.php(748): XFES\Elasticsearch\Api->search(Array)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(144): XFES\Search\Source\Elasticsearch->executeSearch(Object(XF\Search\Query\KeywordQuery), Array, '100')
#4 src/XF/Search/Search.php(183): XFES\Search\Source\Elasticsearch->search(Object(XF\Search\Query\KeywordQuery), '100')
#5 src/XF/Search/Search.php(212): XF\Search\Search->XF\Search\{closure}(Object(XF\Search\Query\KeywordQuery), '100')
#6 src/XF/Search/Search.php(179): XF\Search\Search->executeSearch(Object(XF\Search\Query\KeywordQuery), '100', Object(Closure), true)
#7 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(XF\Search\Query\KeywordQuery))
#8 src/XF/Pub/Controller/Search.php(430): XF\Repository\Search->runSearch(Object(XF\Search\Query\KeywordQuery), Array, true)
#9 src/XF/Pub/Controller/Search.php(117): XF\Pub\Controller\Search->runSearch(Object(XF\Search\Query\KeywordQuery), Array)
#10 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', Object(XF\Mvc\RouteMatch), Object(vw\vw\XF\Pub\Controller\Search), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(vw\vw\XF\Pub\Controller\Search), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#15 src/XF.php(488): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
["url"] => string(14) "/search/search"
["referrer"] => string(45) "https://www......com/search/search"
["_GET"] => array(1) {
["/search/search"] => string(0) ""
}
["_POST"] => array(3) {
["keywords"] => string(6) "awgwah"
["c"] => array(1) {
["users"] => string(0) ""
}
["_xfToken"] => string(8) "********"
}
}
Only thing that helps is to uncheck all boxes in "Exclude content-types from generic search results"