Update schema for Elasticsearch 5 and 6 #372
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes our Elasticsearch schema compatible with Elasticsearch 5 and 6. It shouldn't have any effect on performance or operation, but it will completely drop compatibility for Elasticsearch 2.
The primary change is that Elasticsearch 5 introduces two types of text fields:
text
andkeyword
, whereas Elasticsearch 2 only had 1:string
.Roughly, a
text
field is for true full text search and akeyword
field is for simple values that are primarily used for filtering or aggregation (for example, oursource
andlayer
fields). Thestring
datatype previously filled both of those roles depending on how it was configured.Fortunately, we had already roughly created a concept similar to the
keyword
datatype in our schema, but called itliteral
. This has been renamed tokeyword
to cut down on the number of terms neededOne nice effect of this change is that it removes all deprecation warnings printed by Elasticsearch 5. Notably, as discovered in #337 (comment), these warnings were quite noisy and required special handling to work around Node.js header size restrictions. This special handling can now been removed.
Fixes pelias/whosonfirst#457
Connects pelias/pelias#719
Connects pelias/pelias#461