Records Stored in Elasticsearch:
"hits" : [ {
"_index" : "test",
"_type" : "test_doc",
"_id" : "AVUHBSESPB1nLi5k2Dxp",
"_score" : 1.0,
"_source":{"valid": true,"action_taken": false}
}, {
"_index" : "test",
"_type" : "test_doc",
"_id" : "AVUHBI1IPB1nLi5k2Dxo",
"_score" : 1.0,
"_source":{"valid": true,"action_taken": false}
}, {
"_index" : "test",
"_type" : "test_doc",
"_id" : "AVUHWFipPB1nLi5k2Dxu",
"_score" : 1.0,
"_source":{"valid": false,"action_taken": false}
} ]
We need to find those records whose valid is true and action_taken is false in python script using elasticsearch python package.
We are trying to do the same using
resp = ES.search(index='test', doc_type='test_doc', q='action_taken:0 valid:1)
However on execution, it returns all the records. Is there any possible way to do the same using search.
PS: I am trying to write an API call which searches the records based on the search condition provided as json data in the request.