Hi elastic wizards.
I have strange issue with elasticsearch (7.11). I have an index called "test_index", and when I query it using curl and "match_all" it returns a value, but when I use the node js client, it does not.
Here is the curl:
curl https://some_url/test_index/_search?pretty -H 'Content-type: application/json' -d '{"size":100,"from":0,"sort":[{"time":"desc"}],"query":{"match_all":{}}}'
and here is the nodejs query:
{"index":"test_index","size":100,"body":{"sort":[{"time":"desc"}],"query":{"match_all":{}}},"from":0}
After creating the query obj in node, I just use
esClient.search(EntireObj)
.
The nodejs syntax was taken from:
Search | Elasticsearch Node.js client [7.x] | Elastic
There are no errors, just empty hits array in the nodejs case.
What is wrong in my nodejs syntax that causes the "match_all" search to return nothing?
Thanks!