When configuring synonyms, then Photon rewrites the index mappings from scratch. This ties the index layout to the Photon version instead of the current database import. This in turn restricts changes to the layout and analysers to major Photon versions. It also prevents customization of the analysers, for example, to adapt to the language of the data.
We need to be able to set and change synonyms without affecting the index mapping. Two possible ideas for a solution:
- Move synonyms and classification terms out of OpenSearch and do the preprocessing ourselves. Probably means that we need to create multiple queries for different interpretations of the query, a bit like Nominatim does.
- Always have a synonym and classification filter and only change the synonym terms on startup. This means reading the database layout description from the database, changing the relevant fields and writing the configuration back.
When configuring synonyms, then Photon rewrites the index mappings from scratch. This ties the index layout to the Photon version instead of the current database import. This in turn restricts changes to the layout and analysers to major Photon versions. It also prevents customization of the analysers, for example, to adapt to the language of the data.
We need to be able to set and change synonyms without affecting the index mapping. Two possible ideas for a solution: