Synonym list + classification terms #585
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 PR extends #581 and adds classification terms. The classification terms enable searches where the descriptive term of the place is given in addition to the name ('London airport', 'Louvre museum', ...). Like synonyms, the classification terms are restricted to single word terms. This is a restriction in the synonym module of ES5. See
docs/synonyms.md
for more information on the new format of the synonym file.Classification terms work by adding a cryptic term that is derived from the OSM key and value and usually does not interfere with any other search terms. The cryptic term is added to the collector and then we define synonyms from the actual classification terms to the cryptic term. This means that we can stay with a single query and have ES decide if a term should be interpreted as a classification term or as part of a name. It also means that classification terms can be changed on an existing database, given that they are just query time synonyms.
As classification terms need to be newly indexed, a mapping schema change and reimport is required and the database version has increased.
Partially implements #557. Classification terms cannot be used for searching by type ('museum in Paris', 'airport near London').
Fixes #318.