I am trying to write a query which can search a particular word in a field in between the mentioned dates. So, I should use search and range query. I have written a query but I think I am doing something wrong.
can you explain why you are thinking that you are wrong? What happens when you execute this query? Is there an error message? Are wrong documents being returned? Are those documents correctly indexed with date fields? Which Elasticsearch version is this? Have you tried to reproduce your example with curl/plain HTTP and provide this query as well so others can help?
I am using elasticsearch 5.4.1 Normal curl command works fine and gives the correct results. Index and mapping are correct.
I am getting this error
PHP Fatal error: Uncaught exception 'Elasticsearch\Common\Exceptions\BadRequest400Exception' with message '{"error":{"root_cause":[{"type":"parsing_exception","reason":"[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":1,"col":63}],"type":"parsing_exception","reason":"[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":1,"col":63},"status":400}' in /home/akhil/Documents/june/elastic/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:610
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.