Closed Danwhy closed 8 years ago
The idea for the synonyms is to update the list of match keywords without reindexing all the database. I manage to test the synonyms search:
From now we can update the list of synonyms and we only need to update the settings of the index (so no need to reindex) to be able to search at query time. I don't think we need to apply the synonyms at index time:
However this kind of search synonyms only work well for only one word synonym. I'm looking now how to search for multiple word synonym (https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-word-synonyms.html).
@jamieu do you have an exemple of synonym that we can try to imlement? Do you also think that we will need to work with multiword synonym?
Two off the top of my head...
"trains, locomotives, rolling stock" -> locomotives "orthodontics, dentistry, teeth, dental" -> dentistry
The script to update the list of synonyms is working on my localhsot elasticsearch, however I can't test it on the real database as we don't have the rights to modify the settings of the database:
@jamieu would it be possible to have a specific user with the rights to change the settings?
It looks like the ideal way of dealing with synonyms is to use the synonym token filter, which has to be done at index-time.
We could do this in another way for now, using some kind of json file and comparison at query time, but it would obviously not be as efficient. @jamieu thoughts?