# Search failing Elasticsearch

**URL:** <https://discuss.elastic.co/t/search-failing-elasticsearch/195616>\
**Category:** Elasticsearch\
**Created:** [August 17, 2019, 6:57pm UTC](https://discuss.elastic.co/t/search-failing-elasticsearch/195616 "2019-08-17T18:57:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![w0lfxpunk](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@w0lfxpunk](https://discuss.elastic.co/u/w0lfxpunk)\
**Post date:** [August 17, 2019, 6:57pm UTC](https://discuss.elastic.co/t/search-failing-elasticsearch/195616/1 "2019-08-17T18:57:23Z")

</div>

Dear All,  
I have integrated elasticsearch with magento2 following all the official documents. I can see indices are being created , but whenever I try to search anything I get below error  
[DEBUG][o.e.a.s.TransportSearchAction] [D\_HnZg\_] [stu22\_product\_1\_v2][4], node[D\_HnZg\_xQuWUe5avniqpCg], [P], s[STARTED], a[id=jJSY3o0LREW-qWWRQmPGJw]: Failed to execute [SearchRequest{searchType=QUERY\_THEN\_FETCH, indices=[stu22\_product\_1], indicesOptions=IndicesOptions[id=38, ignore\_unavailable=false, allow\_no\_indices=true, expand\_wildcards\_open=true, expand\_wildcards\_closed=false, allow\_aliases\_to\_multiple\_indices=true, forbid\_closed\_indices=true, ignore\_aliases=false], types=[document], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=5, batchedReduceSize=512, preFilterShardSize=128, source={  
"from" : 0,  
"size" : 32,  
"query" : {  
"bool" : {  
"must" : [  
{  
"terms" : {  
"visibility" : [  
"3",  
"4"  
],  
"boost" : 1.0  
}  
}  
],  
"should" : [  
{  
"match" : {  
"sku" : {  
"query" : "alta",  
"operator" : "OR",  
"prefix\_length" : 0,  
"max\_expansions" : 50,  
"fuzzy\_transpositions" : true,  
"lenient" : false,  
"zero\_terms\_query" : "NONE",  
"boost" : 2.0  
}  
}  
},  
{  
"match" : {  
"\_search" : {  
"query" : "alta",  
"operator" : "OR",  
"prefix\_length" : 0,  
"max\_expansions" : 50,  
"fuzzy\_transpositions" : true,  
"lenient" : false,  
"zero\_terms\_query" : "NONE",  
"boost" : 2.0  
}  
}  
},  
{  
"match" : {  
"name" : {  
"query" : "alta",  
"operator" : "OR",  
"prefix\_length" : 0,  
"max\_expansions" : 50,  
"fuzzy\_transpositions" : true,  
"lenient" : false,  
"zero\_terms\_query" : "NONE",  
"boost" : 6.0  
}  
}  
},  
{  
"match" : {  
"description" : {  
"query" : "alta",  
"operator" : "OR",  
"prefix\_length" : 0,  
"max\_expansions" : 50,  
"fuzzy\_transpositions" : true,  
"lenient" : false,  
"zero\_terms\_query" : "NONE",  
"boost" : 2.0  
}  
}  
},  
{  
"match" : {  
"short\_description" : {  
"query" : "alta",  
"operator" : "OR",  
"prefix\_length" : 0,  
"max\_expansions" : 50,  
"fuzzy\_transpositions" : true,  
"lenient" : false,  
"zero\_terms\_query" : "NONE",  
"boost" : 2.0  
}  
}  
}  
],  
"adjust\_pure\_negative" : true,  
"minimum\_should\_match" : "1",  
"boost" : 1.0  
}  
},  
"stored\_fields" : [  
"\_id",  
"_score"  
],  
"sort" : [  
{  
"am\_relevance" : {  
"order" : "desc"  
}  
}  
],  
"aggregations" : {  
"prices" : {  
"histogram" : {  
"field" : "price\_0\_1",  
"interval" : 1000.0,  
"offset" : 0.0,  
"order" : {  
"key" : "asc"  
},  
"keyed" : false,  
"min\_doc\_count" : 1  
}  
}  
}  
}}]  
org.elasticsearch.transport.RemoteTransportException: [D\_HnZg][127.0.0.1:9300][indices:data/read/search[phase/query]]  
Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found for [am\_relevance] in order to sort on  
at org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:263) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:154) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:686) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService.createContext(SearchService.java:530) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:506) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:302) ~[elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:288) [elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:284) [elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.search.SearchService$3.doRun(SearchService.java:964) [elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) [elasticsearch-6.0.1.jar:6.0.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.0.1.jar:6.0.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]  
at java.lang.Thread.run(Thread.java:834) [?:?]  
[2019-08-17T18:50:55,787][DEBUG][o.e.a.s.TransportSearchAction] [D\_HnZg_] All shards failed for phase: [query]  
Please help

---

<div class="post-metadata">

**Author:** ![w0lfxpunk](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@w0lfxpunk](https://discuss.elastic.co/u/w0lfxpunk)\
**Post date:** [August 19, 2019, 4:26am UTC](https://discuss.elastic.co/t/search-failing-elasticsearch/195616/2 "2019-08-19T04:26:17Z")

</div>

can someone please help ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 16, 2019, 4:26am UTC](https://discuss.elastic.co/t/search-failing-elasticsearch/195616/3 "2019-09-16T04:26:25Z")

</div>

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