#community-help

Managing Synonyms in Collection Updates

TLDR Jon sought the best practice for persisting synonyms with new alias collection updates. Jason suggested re-uploading synonyms with each update, gave an insight into future plans of shared synonym lists across collections and recommended creating a GitHub issue.

Powered by Struct AI

2

1

1

Jul 14, 2022 (15 months ago)
Jon
Photo of md5-9d01f9f3c352222b5a7902d087745dc3
Jon
02:22 PM
Hi! I have a question about Synonyms. Whats the best practice for getting a list of synonyms to persist each time a collection is updated from a new alias?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:51 PM
This is indeed a little painful to manage at the moment. You would have to export the synonyms from the old collection using the API and then import them into the new collection
03:51
Jason
03:51 PM
We plan to solve this by making synonym lists be shared across collections
Rebecca
Photo of md5-051f535431ff484f44f165e9a0b696a5
Rebecca
03:53 PM
when would we be able to expect this fix to go out?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:55 PM
It’s currently in the backlog and is not scheduled for the near future, given other priorities. So we don’t have an ETA for it currently
Jon
Photo of md5-9d01f9f3c352222b5a7902d087745dc3
Jon
03:56 PM
ok. this is manageable but yeah we would love to have synonyms shared across our collections and to persist on collection updates.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:57 PM
We prioritize based on community feedback though, so could you open a Github issue so we can track interest?
Jon
Photo of md5-9d01f9f3c352222b5a7902d087745dc3
Jon
03:57 PM
sure!

1

06:44
Jon
06:44 PM
can I upload an entire synonyms array, or do I have to upsert by one set of synonyms at a time? The docs only show the latter: client.collections('products').synonyms.upsert('smart-phone-synonyms', synonym)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:45 PM
You would have to upsert one by one

1

Jon
Photo of md5-9d01f9f3c352222b5a7902d087745dc3
Jon
06:45 PM
ouch! ok
06:47
Jon
06:47 PM
I’m a bit nervous there will be a short delay between the time an alias changes and the time the synonyms are updated.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:48 PM
I would recommend adding the synonyms to the new collection before switching the alias

2

Jul 15, 2022 (15 months ago)
Doug
Photo of md5-f2185fa219bdd84e1b144f8600162721
Doug
03:13 PM
Adding to this, what permissions does an API key need to manage synonyms? I thought
"actions": ["collections:*"]

would do it but that didn't seem to work. Is it a separate action?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:43 PM
Yeah, it should be synonyms:*
Doug
Photo of md5-f2185fa219bdd84e1b144f8600162721
Doug
04:48 PM
thanks!
Oct 05, 2022 (12 months ago)
Jon
Photo of md5-9d01f9f3c352222b5a7902d087745dc3
Jon
07:56 PM
Hi! Just wondering if we still need to re-upload these, or if there is a way for them to persist? cc Colin
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:57 PM
Hi Jon, you still have to reupload synonyms when you create a new collection.