Elastic Search integration with Magneto 2.3.3 Version

I am getting empty results while searching for the frontend. Got the below error in log file.

main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [position~asc] in order to sort on","index_uuid":"rJsF6r3yS5OPrTn7iUcIkg","index":"tc_dev_product_1_v2"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"tc_dev_product_1_v2","node":"kA6-CxIIQ_KGdGAKF5mgGA","reason":{"type":"query_shard_exception","reason":"No mapping found for [position~asc] in order to sort on","index_uuid":"rJsF6r3yS5OPrTn7iUcIkg","index":"tc_dev_product_1_v2"}}]},"status":400} {"exception":"[object] (Elasticsearch\Common\Exceptions\BadRequest400Exception(code: 400): {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [position~asc] in order to sort on","index_uuid":"rJsF6r3yS5OPrTn7iUcIkg","index":"tc_dev_product_1_v2"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"tc_dev_product_1_v2","node":"kA6-CxIIQ_KGdGAKF5mgGA","reason":{"type":"query_shard_exception","reason":"No mapping found for [position~asc] in order to sort on","index_uuid":"rJsF6r3yS5OPrTn7iUcIkg","index":"tc_dev_product_1_v2"}}]},"status":400} at /var/app/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:636)"}

I checked the below commands in the elastic search server and got like this,

Command : curl http://localhost:9200/index/_mapping?pretty

Output : {
"error" : {
"root_cause" : [
{
"type" : "index_not_found_exception",
"reason" : "no such index",
"resource.type" : "index_or_alias",
"resource.id" : "index",
"index_uuid" : "na",
"index" : "index"
}
],
"type" : "index_not_found_exception",
"reason" : "no such index",
"resource.type" : "index_or_alias",
"resource.id" : "index",
"index_uuid" : "na",
"index" : "index"
},
"status" : 404
}

Elastic suite server verison : 6.8.5

What could be the issue? Can someone please help to solve this issue. Thanks in advance.

The index name is tc_dev_product_1_v2 not index.

Call:

curl http://localhost:9200/tc_dev_product_1_v2/_mapping?pretty

If you want to share the output, please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

Hi David,
Thanks for your response and sorry for the inconvenience caused. I will follow your comment in further query.

I will check this and let you know.

Thanks,

Hi David,

I tried the curl command which you have shared and getting the same issue. Please find screenshot for your reference.turfcare

Thanks,

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with </> icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

What is the output of:

GET /_cat/indices?v

Note that you can run this command in Kibana Dev Console.
Otherwise transform it to curl command like:

curl -XGET http://localhost:9200/_cat/indices?v

While running the following command, I got the below result

Command :

curl -XGET http://localhost:9200/_cat/indices?v

Result :

   ubuntu@ip-172-31-19-11:~$ curl -XGET http://localhost:9200/_cat/indices?v
    health status index                                             uuid                   pri rep docs.count docs.deleted store.size pri.store.size
    yellow open   tc_dev_product_3_v8                               17H7wt8mRL6QVSz_KkkBUg   5   1     144068            0     21.4mb         21.4mb
    yellow open   tc_dev_product_1_v8                               _KpItME4RkynV_ZXse-tGQ   5   1     144068            0     21.6mb         21.6mb
    yellow open   adam_turfcare_product_1_v2                        5cX7njCfRc6fJqVcVWnxbQ   5   1      10001            0      1.6mb          1.6mb
    green  open   magento2_default_thesaurus_20200527_201730        ndgMX27LTC2n1y5cX6bS3w   1   0          0            0       261b           261b
    green  open   magento2_default_catalog_category_20200527_201727 i7WKdIqjQ7iCYETrNUm9Vw   1   0         35            0     27.2kb         27.2kb

Then I try the below command and get some outputs (its too large one).

Command:

curl http://localhost:9200/tc_dev_product_3_v8/_mapping?pretty

Thanks

Share it on gist.github.com if too large.

Please find below the gist link here,

Gist GitHub URL

Thanks,

There's no field named position~asc in your mapping.
That explains why you can not sort on this field.

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