Im trying to migrate from elasticsearch 1.7 to 5.1 and I have a problem:
curl -XGET http://127.0.0.1:9200/openlist_ru-formulars/formular/_search?pretty=true -d '{ "filter": [ { "range": { "born": { "gte": "1874" }}} ] }'
and answer:
{ "error" : { "root_cause" : [ { "type" : "parsing_exception", "reason" : "Unknown key for a START_OBJECT in [filters].", "line" : 2, "col" : 12 } ], "type" : "parsing_exception", "reason" : "Unknown key for a START_OBJECT in [filters].", "line" : 2, "col" : 12 }, "status" : 400 }
I used google all the day but still have no answer what it means. Please help.
It looks like DSL structure in 5.1 version was changed and this query is good:
{ "query": { "bool": { "filter": [{ "range": { "born": { "gte": "1874" } } }] } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With