One day elasticsearch stopped working properly on my magento. I’ve installed sampledata, ran reindex. I have total 188 products count in elastic. I’m trying to search something with quick search, but it returns me all products in response.
I dived into the code and found that JSON does not contain any information about my query. I see that necessary filter is present, but at some moment – it is disappearing.
Here is my JSON:
{ "index":"magento2_product_1", "type":"document", "body":{ "from":"0", "size":"10000", "fields":[ "_id", "_score" ], "query":{ "bool":{ "must":[ { "term":{ "category_ids":"2" } } ], "minimum_should_match":1 } } } }
Same JSON in one row:
{"index":"magento2_product_1","type":"document","body":{"from":"0","size":"10000","fields":["_id","_score"],"query":{"bool":{"must":[{"term":{"category_ids":"2"}}],"minimum_should_match":1}}}}
As you may notice, it doesn’t have search_term
, and as result response is wrong.
Can anybody provide me correct JSON which magento sends to elasticsearch and maybe somebody can direct me why it could happen?