I'm trying to do the following term filter
{
"query": {
"term": {
"name": "terry harvey"
}
}
}
and I'm getting 0 hits
{
took: 3
timed_out: false
_shards: {
total: 5
successful: 5
failed: 0
}
hits: {
total: 0
max_score: 0
hits: [ ]
}
}
When I used the "match filter" instead "term filter", I get 48 hits.
What am I doing wrong? =(
Thanks!
Term queries and filters are not analyzed, meaning they will only find exact matches. On the other hand, match queries are analyzed and your name field is probably being analyzed as well. More info here.