Skip to content

Commit

Permalink
Use keyword field for term query and terms agg (#107)
Browse files Browse the repository at this point in the history
With this commit we use the keyword subfield in the `geonames` track for
the `term` query and aggregations that aggregate on terms. While the
terms aggregation produces correct results on a `text` field, the `term`
query does not return any results (which is unintended).
  • Loading branch information
danielmitterdorfer committed Mar 13, 2020
1 parent 14a7331 commit 1e83b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geonames/operations/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"body": {
"query": {
"term": {
"country_code": "AT"
"country_code.raw": "AT"
}
}
}
Expand All @@ -53,7 +53,7 @@
"aggs": {
"country_population": {
"terms": {
"field": "country_code"
"field": "country_code.raw"
},
"aggs": {
"sum_population": {
Expand All @@ -75,7 +75,7 @@
"aggs": {
"country_population": {
"terms": {
"field": "country_code"
"field": "country_code.raw"
},
"aggs": {
"sum_population": {
Expand Down

0 comments on commit 1e83b6d

Please sign in to comment.