How could I have MySQL IN clause within my elasticsearch query?


(Kulasangar Gowrisangar) #1

I'm trying perform an elasticsearch query as a GET request in order pull data from the index which I created. The data which is in the index is, a table from MySQL DB, configured though logstash.

Here is my request without the IN clause:

http://localhost:9200/response_summary/_search?q=myquery

In the above, I should be able to append AND responseCode IN (401,403). I tried giving it a search on the web, but couldn't find any solutions.

Any help could be appreaciated.


(Kulasangar Gowrisangar) #2

Found the solution, I've appended it at the end:

http://localhost:9200/response_summary/_search?q=myquery+responsecode:(401+404)


(David Pilato) #3

I'd recommend using the query DSL instead.
You can clearly express what you want to do.


(system) #4