I have a query looking like this:
((company_id:1) AND (candidate_tags:"designer"))
However this also matches users where candidate_tags
is interaction designer
. How do I exclude these?
Here's my full search body:
{
"query": {
"filtered": {
"query": {
"query_string": {
"query":
"((company_id:1) AND (candidate_tags:\"designer\"))"
}
}
}
}
"sort":{
"candidate_rating":{
"order":"desc"
},
"candidate_tags",
"_score"
}
}
Extra info
Realised now that an answer came in: candidate_tags
is an array of strings, and say, a candidate has the tags interaction designer
and talent
, searching for talent
should be a match but designer
should not.
candidate_tags
field asnot_analyzed
or analyzed withkeyword
analyzer. – Andrei Stefan