Skip to content

Commit

Permalink
Add fields country_name and region_iso_code to geo. (#214)
Browse files Browse the repository at this point in the history
Also group/sort geo fields by format and location "size" :-)
  • Loading branch information
webmat authored Dec 6, 2018
1 parent 38685e0 commit bba50bb
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file based on the
* Reintroduce `http`. #237
* Add `user.full_name` field. #201
* Add `network.community_id` field. #208
* Add fields `geo.country_name` and `geo.region_iso_code`. #214

### Improvements
* Improved the definition of the file fields #196
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,13 @@ Note also that the `geo` fields are not expected to be used directly at the top

| Field | Description | Level | Type | Example |
|---|---|---|---|---|
| <a name="geo.continent_name"></a>geo.continent_name | Name of the continent. | core | keyword | `North America` |
| <a name="geo.country_iso_code"></a>geo.country_iso_code | Country ISO code. | core | keyword | `CA` |
| <a name="geo.location"></a>geo.location | Longitude and latitude. | core | geo_point | `{ "lon": -73.614830, "lat": 45.505918 }` |
| <a name="geo.continent_name"></a>geo.continent_name | Name of the continent. | core | keyword | `North America` |
| <a name="geo.country_name"></a>geo.country_name | Country name. | core | keyword | `Canada` |
| <a name="geo.region_name"></a>geo.region_name | Region name. | core | keyword | `Quebec` |
| <a name="geo.city_name"></a>geo.city_name | City name. | core | keyword | `Montreal` |
| <a name="geo.country_iso_code"></a>geo.country_iso_code | Country ISO code. | core | keyword | `CA` |
| <a name="geo.region_iso_code"></a>geo.region_iso_code | Region ISO code. | core | keyword | `CA-QC` |


## <a name="group"></a> Group fields
Expand Down
34 changes: 24 additions & 10 deletions fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -624,26 +624,26 @@
type: group
fields:

- name: location
level: core
type: geo_point
description: >
Longitude and latitude.
example: '{ "lon": -73.614830, "lat": 45.505918 }'

- name: continent_name
level: core
type: keyword
description: >
Name of the continent.
example: North America

- name: country_iso_code
- name: country_name
level: core
type: keyword
description: >
Country ISO code.
example: CA

- name: location
level: core
type: geo_point
description: >
Longitude and latitude.
example: '{ "lon": -73.614830, "lat": 45.505918 }'
Country name.
example: Canada

- name: region_name
level: core
Expand All @@ -659,6 +659,20 @@
City name.
example: Montreal

- name: country_iso_code
level: core
type: keyword
description: >
Country ISO code.
example: CA

- name: region_iso_code
level: core
type: keyword
description: >
Region ISO code.
example: CA-QC

- name: group
title: Group
group: 2
Expand Down
2 changes: 2 additions & 0 deletions schema.csv
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ file.uid,keyword,extended,
geo.city_name,keyword,core,Montreal
geo.continent_name,keyword,core,North America
geo.country_iso_code,keyword,core,CA
geo.country_name,keyword,core,Canada
geo.location,geo_point,core,"{ ""lon"": -73.614830, ""lat"": 45.505918 }"
geo.region_iso_code,keyword,core,CA-QC
geo.region_name,keyword,core,Quebec
group.id,keyword,extended,
group.name,keyword,extended,
Expand Down
34 changes: 24 additions & 10 deletions schemas/geo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
type: group
fields:

- name: location
level: core
type: geo_point
description: >
Longitude and latitude.
example: '{ "lon": -73.614830, "lat": 45.505918 }'

- name: continent_name
level: core
type: keyword
description: >
Name of the continent.
example: North America

- name: country_iso_code
- name: country_name
level: core
type: keyword
description: >
Country ISO code.
example: CA

- name: location
level: core
type: geo_point
description: >
Longitude and latitude.
example: '{ "lon": -73.614830, "lat": 45.505918 }'
Country name.
example: Canada

- name: region_name
level: core
Expand All @@ -49,3 +49,17 @@
description: >
City name.
example: Montreal

- name: country_iso_code
level: core
type: keyword
description: >
Country ISO code.
example: CA

- name: region_iso_code
level: core
type: keyword
description: >
Region ISO code.
example: CA-QC
8 changes: 8 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,17 @@
"ignore_above": 1024,
"type": "keyword"
},
"country_name": {
"ignore_above": 1024,
"type": "keyword"
},
"location": {
"type": "geo_point"
},
"region_iso_code": {
"ignore_above": 1024,
"type": "keyword"
},
"region_name": {
"ignore_above": 1024,
"type": "keyword"
Expand Down

0 comments on commit bba50bb

Please sign in to comment.