ElasticSearch feature "synonym"

Hi all!

In these days, we’ve analyzed the search requirements for a specific project, and we have some considerations:

a) We can use synonyms in query time programmatically looking at the user query and finding words that we have in our database marked as a synonym and putting dynamically a “OR” clause in a fulltext function to apply all synonyms registered. The disadvantage here is that we lost performance, but we think that it works.

b) To satisfy the requirements with better performance, Enonic would need to implement Synonym in index time. According to Elasticsearch documentation, this is the better approach to guarantee performance results.

More details on reference:
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/analysis-synonym-tokenfilter.html
https://www.elastic.co/guide/en/elasticsearch/guide/current/synonyms-expand-or-contract.html

Or any other suggestion about it, please.

Please let us know if you also see any other possibilities to deliver that requirement.

I’m assuming you plan to search cms content here? I see no reason why to worry about performance here, query time expansion will do the job nicely.

If you absolutely need index time synonyms, this can be solved by implementing contentProcessors that are executed before the content is saved.

1 Like