Elastic search queries via URL change from Version 2.1 to 6.3

Hi there,

I have been using an older version of elastic search(2.1) and just recently switched to the newest one, but due to some API changes my URL request unfortunately don't work anymore, they used to look like this:

localhost:9200/myindex/_search?source={"query": {"bool": { "must": [{"range": {"eventTime": {"gt": "now-150s","lte": "now"}}},{"term": {"_id": "someid"}}]}}}, "aggs": {}}&pretty&size=9999'

However, when now using this query with the latest version(6.3) I get this reply:

{
"error" : {
"root_cause" : [
{
"type" : "illegal_state_exception",
"reason" : "source and source_content_type parameters are required"
}
],
"type" : "illegal_state_exception",
"reason" : "source and source_content_type parameters are required"
},
"status" : 500
}

Does anybody know which parameters I have to add? Does this still work like this at all?
I would prefer to stick to this method of doing some requests via URL.

Thanks for any advice!

Check out https://www.elastic.co/guide/en/elasticsearch/reference/6.3/common-options.html#_content_type_requirements

Thank you so much!!!
It works!

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