algoliasearch-rails
algoliasearch-rails copied to clipboard
One-way synonyms?
Do you have an example of how to do one-way synonyms with the DSL?
Do you have an example of how to do one-way synonyms with the DSL?
One-way synonyms are currently not supported in the current DSL. Still wondering how we can handle it because they're not anymore part of the settings and therefore we'll probably need to go for a rake
task to "apply/save" them.
This seems to work:
index.save_synonym('my_object_id', { objectID: 'my_object_id', type: 'oneWaySynonym', input: 'NY', synonyms: ['New York', 'NYC'] }, true)
Same thing for other types of synonyms.
https://www.algolia.com/doc/guides/textual-relevance/synonyms/?language=rails#one-way-synonyms
index.save_synonym('my_object_id', { objectID: 'my_object_id', type: 'oneWaySynonym', input: 'NY', synonyms: ['New York', 'NYC'] }, true)
Right, they are just not part of the algoliasearch
block options.