Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update schema for Elasticsearch 5 and 6 #372

Merged
merged 3 commits into from
Jul 10, 2019
Merged

Conversation

orangejulius
Copy link
Member

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 and keyword, whereas Elasticsearch 2 only had 1: string.

Roughly, a text field is for true full text search and a keyword field is for simple values that are primarily used for filtering or aggregation (for example, our source and layer fields). The string 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 it literal. This has been renamed to keyword to cut down on the number of terms needed

One 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

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` and `keyword`, whereas Elasticsearch 2 only had 1:
`string`.

Roughly, a `text` field is for true full text search and a `keyword`
field is for simple values that are primarily used for filtering or
aggregation (for example, our `source` and `layer` fields). The `string` 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 it `literal`. This has been
renamed to `keyword` to cut down on the number of terms needed

One 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
@orangejulius orangejulius force-pushed the elasticsearch-5-schema branch from 229d7f2 to ae3c4ff Compare July 5, 2019 19:17
Copy link
Member

@missinglink missinglink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@orangejulius
Copy link
Member Author

I've now tested this fairly extensively across several small builds, and can't identify any regressions. The schema is expected to still be equivalent for ES5+, so this is now ready for full planet testing.

@orangejulius orangejulius merged commit 2774f58 into master Jul 10, 2019
@orangejulius orangejulius deleted the elasticsearch-5-schema branch July 10, 2019 22:25
orangejulius added a commit that referenced this pull request Nov 22, 2019
There were previously strict Node.js version compatibility issues with
the schema. However, once we dropped support for Elasticsearch 2 in
#372, this was no longer required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse Error while loading into Elasticsearch Cluster
2 participants