Magento 2.4.1 elasticsearch "There has been an error processing your request" with multiple search words

Hello elasticsearch works perfectly with 1 search word but with more than one search words it gives the dreaded “There has been an error processing your request” with below report:

{“0”:“{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: {\n \"bool\" : {\n \"must\" : [\n {\n \"terms\" : {\n \"visibility\" : [\n \"3\",\n \"4\"\n ],\n \"boost\" : 1.0\n }\n }\n ],\n \"should\" : [\n {\n \"match\" : {\n \"_search\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"sku\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 7.0\n }\n }\n },\n {\n \"match\" : {\n \"manufacturer_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"color_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"status_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"url_key\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"tax_class_id_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"tt\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"at\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 3.0\n }\n }\n },\n {\n \"match\" : {\n \"i13\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 5.0\n }\n }\n },\n {\n \"match\" : {\n \"i10\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 6.0\n }\n }\n },\n {\n \"match\" : {\n \"_search\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match_phrase_prefix\" : {\n \"name\" : {\n \"query\" : \"intelligent investor\",\n \"slop\" : 0,\n \"max_expansions\" : 50,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match_phrase_prefix\" : {\n \"sku\" : {\n \"query\" : \"intelligent investor\",\n \"slop\" : 0,\n \"max_expansions\" : 50,\n \"boost\" : 2.0\n }\n }\n }\n ],\n \"adjust_pure_negative\" : true,\n \"minimum_should_match\" : \"1\",\n \"boost\" : 1.0\n }\n}","index_uuid":"WCEe8OuxQciGaOvyZfkMTg","index":"magento2_product_2_v72"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_2_v72","node":"2U4Hg-nLQIup8ZNSnEbIiA","reason":{"type":"query_shard_exception","reason":"failed to create query: {\n \"bool\" : {\n \"must\" : [\n {\n \"terms\" : {\n \"visibility\" : [\n \"3\",\n \"4\"\n ],\n \"boost\" : 1.0\n }\n }\n ],\n \"should\" : [\n {\n \"match\" : {\n \"_search\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"sku\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 7.0\n }\n }\n },\n {\n \"match\" : {\n \"manufacturer_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"color_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"status_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"url_key\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"tax_class_id_value\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"tt\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match\" : {\n \"at\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 3.0\n }\n }\n },\n {\n \"match\" : {\n \"i13\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 5.0\n }\n }\n },\n {\n \"match\" : {\n \"i10\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 6.0\n }\n }\n },\n {\n \"match\" : {\n \"_search\" : {\n \"query\" : \"intelligent investor\",\n \"operator\" : \"OR\",\n \"prefix_length\" : 0,\n \"max_expansions\" : 50,\n \"fuzzy_transpositions\" : true,\n \"lenient\" : false,\n \"zero_terms_query\" : \"NONE\",\n \"auto_generate_synonyms_phrase_query\" : true,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match_phrase_prefix\" : {\n \"name\" : {\n \"query\" : \"intelligent investor\",\n \"slop\" : 0,\n \"max_expansions\" : 50,\n \"boost\" : 2.0\n }\n }\n },\n {\n \"match_phrase_prefix\" : {\n \"sku\" : {\n \"query\" : \"intelligent investor\",\n \"slop\" : 0,\n \"max_expansions\" : 50,\n \"boost\" : 2.0\n }\n }\n }\n ],\n \"adjust_pure_negative\" : true,\n \"minimum_should_match\" : \"1\",\n \"boost\" : 1.0\n }\n}","index_uuid":"WCEe8OuxQciGaOvyZfkMTg","index":"magento2_product_2_v72","caused_by":{"type":"illegal_state_exception","reason":"field:[name] was indexed without position data; cannot run PhraseQuery"}}}]},"status":400}”,“1”:“#1 Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() called at [vendor/react/promise/src/FulfilledPromise.php:28]\n#2 React\Promise\FulfilledPromise->then() called at [vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php:55]\n#3 GuzzleHttp\Ring\Future\CompletedFutureValue->then() called at [vendor/ezimuel/ringphp/src/Core.php:341]\n#4 GuzzleHttp\Ring\Core::proxy() called at [vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:329]\n#5 Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() called at [vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:227]\n#6 Elasticsearch\Connections\Connection->performRequest() called at [vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:105]\n#7 Elasticsearch\Transport->performRequest() called at [vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php:1559]\n#8 Elasticsearch\Client->performRequest() called at [vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php:1192]\n#9 Elasticsearch\Client->search() called at [vendor/magento/module-elasticsearch-7/Model/Client/Elasticsearch.php:367]\n#10 Magento\Elasticsearch7\Model\Client\Elasticsearch->query() called at [vendor/magento/module-elasticsearch/SearchAdapter/Dynamic/DataProvider.php:221]\n#11 Magento\Elasticsearch\SearchAdapter\Dynamic\DataProvider->getAggregation() called at [vendor/magento/framework/Search/Dynamic/Algorithm/Manual.php:48]\n#12 Magento\Framework\Search\Dynamic\Algorithm\Manual->getItems() called at [vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder/Dynamic.php:48]\n#13 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Dynamic->build() called at [vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder.php:89]\n#14 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder->build() called at [vendor/magento/module-elasticsearch-7/SearchAdapter/Adapter.php:128]\n#15 Magento\Elasticsearch7\SearchAdapter\Adapter->query() called at [vendor/magento/module-search/Model/SearchEngine.php:42]\n#16 Magento\Search\Model\SearchEngine->search() called at [vendor/magento/framework/Search/Search.php:85]\n#17 Magento\Framework\Search\Search->search() called at [vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext/Collection.php:465]\n#18 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->_renderFiltersBefore() called at [vendor/magento/framework/Data/Collection/AbstractDb.php:343]\n#19 Magento\Framework\Data\Collection\AbstractDb->_renderFilters() called at [vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext/Collection.php:583]\n#20 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->_renderFilters() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:923]\n#21 Magento\Eav\Model\Entity\Collection\AbstractCollection->load() called at [vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:832]\n#22 Magento\Catalog\Model\ResourceModel\Product\Collection->load() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#23 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#24 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#25 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php:257]\n#26 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->load() called at [vendor/magento/framework/Data/Collection.php:839]\n#27 Magento\Framework\Data\Collection->getIterator() called at [generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php:1292]\n#28 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->getIterator() called at [vendor/magento/module-catalog/Block/Product/ListProduct.php:366]\n#29 Magento\Catalog\Block\Product\ListProduct->getIdentities() called at [generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php:113]\n#30 Magento\Catalog\Block\Product\ListProduct\Interceptor->getIdentities() called at [vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php:96]\n#31 Magento\PageCache\Model\Layout\LayoutPlugin->afterGetOutput() called at [vendor/magento/framework/Interception/Interceptor.php:146]\n#32 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#33 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:347]\n#34 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]\n#35 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]\n#36 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#37 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#38 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#39 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:95]\n#40 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/View.php:221]\n#41 Magento\Framework\App\View->renderLayout() called at [vendor/magento/module-catalog-search/Controller/Result/Index.php:168]\n#42 Magento\CatalogSearch\Controller\Result\Index->getNotCacheableResult() called at [vendor/magento/module-catalog-search/Controller/Result/Index.php:110]\n#43 Magento\CatalogSearch\Controller\Result\Index->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#44 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#45 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php:51]\n#46 Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#47 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#48 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php:23]\n#49 Magento\CatalogSearch\Controller\Result\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]\n#50 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#51 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#52 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#53 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php:32]\n#54 Magento\CatalogSearch\Controller\Result\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]\n#55 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]\n#56 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#57 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#58 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99]\n#59 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#60 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:75]\n#61 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#62 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#63 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]\n#64 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]\n#65 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]\n#66 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]\n#67 Magento\Framework\App\Bootstrap->run() called at [index.php:39]\n”,“url”:“/nl/catalogsearch/result/?q=intelligent+investor”,“script_name”:“/index.php”,“report_id”:“f5c1741deed42acf82ac42d671d2694579912eabf0a28fe84db67aa7bf5749a8”}

I have resolved the issue. The problem was that I had disabled the “name” attribute for search. Once I enabled it again, searches with multiple search words worked again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.