I use opensearchpy module and search function. I have field x and field y.
I want to write a search with IF X=2 AND Y=3 return record(doc).
Please help me to write this search.
Just like this:
query = {
"query": {
"bool": {
"must": [
{
"term": {
"x": 2
}
},
{
"term": {
"y": 3
}
}
]
}
}
}
response = client.search(
body = query,
index = 'your-index'
)