The query below is what I would like to construct using elasticsearch-dsl-py, but I do not know how to do it.
GET /my_index/_search
{
"query": {
"filtered": {
"filter": {
"bool": {
"should": [
{
"term": {
"status": "a"
},
"term": {
"status": "b"
},
"term": {
"status": "c"
}
}
]
}
}
}
}
}
I just want to execute a query like below in SQL format
select * from my_index where status in ("a","b","c")
Using elasticsearch-dsl-py, this is as close as I can get, but it is not the same.
class MyIndex(Document):
status = Keyword() / Text()
MyIndex.search().filter('should', status=["a","b","c"])