We have installed Elasticsearch on our Pre-production server.
Environment we have:
Elasticsearch installed Version: 6.8.3
Magento Commerce version: 2.3.2
SplitDB enabled
Catalogsearch Fulltext indexing performed
Now we are seeing below error in exception log:
Cannot search on field [sku] since it is not indexed.
"index_uuid":"kjokQil4SOStrqow3pCUmA","index":"magento2_product_1_v59"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v59","node":"EHgFvfr7QbuI9Td_Xipa1w","reason":{"type":"query_shard_exception","reason":"failed to create query:
$ curl -XGET 'localhost:9200/_cat/health?v&pretty'
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1568899757 13:29:17 elasticsearch yellow 1 1 70 70 0 0 70 0 - 50.0%
$ curl localhost:9200/_cluster/allocation/explain
{"index":"magento2_product_6_v16","shard":3,"primary":false,"current_state":"unassigned","unassigned_info":{"reason":"CLUSTER_RECOVERED","at":"2019-09-19T06:25:26.198Z","last_allocation_status":"no_attempt"},"can_allocate":"no","allocate_explanation":"cannot allocate because allocation is not permitted to any of the nodes","node_allocation_decisions":[{"node_id":"EHgFvfr7QbuI9Td_Xipa1w","node_name":"EHgFvfr","transport_address":"10.0.0.88:9300","node_attributes":{"ml.machine_memory":"32151568384","xpack.installed":"true","ml.max_open_jobs":"20","ml.enabled":"true"},"node_decision":"no","deciders":[{"decider":"same_shard","decision":"NO","explanation":"the shard cannot be allocated to the same node on which a copy of the shard already exists [[magento2_product_6_v16][3], node[EHgFvfr7QbuI9Td_Xipa1w], [P], s[STARTED], a[id=E_fEa6NPQ8um7zeN4lxsKg]]"}]}]}
Below are the detailed exception log:
{"exception":"[object] (Elasticsearch\Common\Exceptions\BadRequest400Exception(code: 400): {"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: {
\"bool\" : {
\"must\" : [
{
\"terms\" : {
\"visibility\" : [
\"3\",
\"4\"
],
\"boost\" : 1.0
}
}
],
\"should\" : [
{
\"match\" : {
\"sku\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 2.0
}
}
},
{
\"match\" : {
\"_search\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 2.0
}
}
},
{
\"match\" : {
\"name\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 6.0
}
}
}
],
\"adjust_pure_negative\" : true,
\"minimum_should_match\" : \"1\",
\"boost\" : 1.0
}
}","index_uuid":"kjokQil4SOStrqow3pCUmA","index":"magento2_product_1_v59"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v59","node":"EHgFvfr7QbuI9Td_Xipa1w","reason":{"type":"query_shard_exception","reason":"failed to create query: {
\"bool\" : {
\"must\" : [
{
\"terms\" : {
\"visibility\" : [
\"3\",
\"4\"
],
\"boost\" : 1.0
}
}
],
\"should\" : [
{
\"match\" : {
\"sku\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 2.0
}
}
},
{
\"match\" : {
\"_search\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 2.0
}
}
},
{
\"match\" : {
\"name\" : {
\"query\" : \"Custom PS4 Controller Skin\",
\"operator\" : \"OR\",
\"prefix_length\" : 0,
\"max_expansions\" : 50,
\"fuzzy_transpositions\" : true,
\"lenient\" : false,
\"zero_terms_query\" : \"NONE\",
\"auto_generate_synonyms_phrase_query\" : true,
\"boost\" : 6.0
}
}
}
],
\"adjust_pure_negative\" : true,
\"minimum_should_match\" : \"1\",
\"boost\" : 1.0
}
}","index_uuid":"kjokQil4SOStrqow3pCUmA","index":"magento2_product_1_v59","caused_by":{"type":"illegal_argument_exception","reason":"Cannot search on field [sku] since it is not indexed."}}}]},"status":400} at vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:636)"}
Could you please do advice for sorting this.?
Thanks,