In mysql, we can Query as: select * from table1 where (name,age) in (('joe',11),('jim',15));
How can I achieve this in Elasticsearch?
You need to combine should with must bools.
Read more here https://www.elastic.co/blog/lost-in-translation-boolean-operations-and-filters-in-the-bool-query
{
"query": {
"bool": {
"should": [{
"bool": {
"must": [{
"match": {
"name": "joe"
}
}, {
"match": {
"age": "11"
}
}]
}
}, {
"bool": {
"must": [{
"match": {
"name": "jim"
}
}, {
"match": {
"age": "15"
}
}]
}
}]
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.