We are working on a new ES project and need to be able to change the synonyms dynamically. For various reasons in our first instance we are not using a file. If we need to change the list do we always have to update the full list, or is it possible to just add/update/delete single synonyms from our list? If we changed to using a file to back our synonyms list instead, would this make any difference, i.e. could we write single updates to the file via the Elastic api?
Unfortunately writing to the synonyms file via the API is currently not possible. Also, currently changes to the synonyms list need to happen while the index is closed.
Are you using the synonyms filter in an index-time or a search-time analyzer? I'm asking because changing synonyms in an analyzer that is used at index time can lead to irritating behaviour. Documents that were indexed with an older synonyms list e.g. will not contain synonym expansions from the updated list. While this is obvious to most developers, end users often to struggle to understand why they don't find certain documents when entering those search terms affected.
Using updatable synonyms lists at search time is possible and the prefered way to go if you need to update the list. We have an open issue about enabling this and are working towards making this kind of update possible.
We are using it at search time, so the indexing is not an issue. For security our cluster is very tightly locked down, so we are trying to find ways to do what we need via the api as much as possible.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.