I would like to request the data that user_id is '1' and name is 'John' . It is easy to write commonly used SQL:
select * from t where user_id = '1' and name = 'John';
But it is not easy for me to make a request for elasticsearch.
First I made a request for user_id :
{ "query" : { "match" : { "user_id" : "1" } } }
And the results were what I expected.
Then I made a request for name :
{ "query" : { "match" : { "name" : "John" } } }
It worked well.
But I could not make a request connecting 2 conditions and work. How can I attach these 2 matching queries to one use and operation?
source share