I try to search on an index for person (by first name and last name) , this part is pretty simple :
GET /my_index/persons/search
{
"query": {
"query_string": {
"query" : "john doe"
}
}
}
In addition I want to exclude the person having a specific id, I tried with a filter
clause but i wasn't able to properly form the query, can you guys help me ?
EDIT
I've tried
{
"query":{
"multi_match":{
"query":"anne mirande",
"fields":[
"first_name",
"last_name"
],
"type":"cross_fields",
"operator":"and"
}
},
"filter":{
"not":{
"term":{
"id":1
}
}
}
}
But it throws be this : Unknown key for a START_OBJECT in [filter].