'Elasticsearch term filter not working?
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!
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Greg Marzouka |
