Hi, I was trying to do updates on non-file synonyms, but it fails.
Do I have to use a file or am I doing it wrong?
Files isn't that well supported in Elasticsearch Cloud.
It is only via Cloud UI or have I missed an API way of uploading a new file?
I know I can close and open the index, but I would like to avoid downtime by just reloading analyzers like mentioned here https://www.elastic.co/blog/boosting-the-power-of-elasticsearch-with-synonyms.
Steps to recreate:
When you update synonyms, you need to make sure existing data in your indexes is re-processed as per new synonyms.
One way that takes care of update without downtime and re-process existing data may be to create a new index with new mapping that includes your inline synonyms.
This is followed by using _reindex API to bring data from old index to new.
Finally, you flip the alias from old to new index.
as you already found out, managing updateble synonyms in-line in the index settings is not possible at the moment and there are no real plans to do so in the future. Instead, we hope to make managing synonyms easier with a dedicated API (see https://github.com/elastic/elasticsearch/issues/38523), however current efforts with that regard have been stalled for a while.
You can see how to upload resources like synonym files to Cloud here I believe: https://github.com/elastic/elasticsearch/issues/38523, however after reading it I'm not 100% sure if uploading a new synonym file as a bundle like described there will make it visible to already running nodes or if there is an alternative cloud API to do that. I would suggest also asking in the cloud forum around here about that since I'm not so knowledgeable around that topic tbh.
These are downloaded and made available when a node is started.
I guess that restart of the deployment is worse than opening and closing the index...
@Jaspreet_Singh thank you but, the reindex is not viable for me, I would like a more realtime way of changing synonyms and not reindexing for every change.
@Henr1k Right - having a synonym file is the way to go.
But I'm curious, how do you plan to re-process already indexed content as per new synonyms. By default only new content that is ingested will be processed as per new syonyms.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.