Am new to elastic search, this is my query to find a exact match in my collection.
{
"query": {
"filtered": {
"query": {
"match": {
"_id": {
"query": "1"
}
}
},
"filter": {
"term" : {
"team_id":"2",
"created_user":"099"
}
}
}
}
}
By running this query I am getting one record, but my problem is its not matching "team_id" filed. When I change team_id to some other value eg: 4, I am still getting the record with team_id = 2, Please help me to write an elastic search query with three fields. Thanks
_idfield is unique, your query always returns one query. You are saying thatGive me the result that has _id=1. Probably, this will return one result, it is not meaningful to filter this result then. It will be better, if you explain what are you trying to do