Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • WombleNumber1 4 posts 85 karma points
    Apr 13, 2021 @ 16:03

    Examine Search - Synonyms

    Hi All,

    I am trying to implement synonym searching in the Examine search engine that comes with Umbraco 8 out of the box.

    Does anyone have any experience with implementing synonym searching in Examine/Umbraco 8. The options that I have been considering after looking around are -

    • A package that can be installed in Umbraco 8 that offers this extended functionality (if one exists).
    • Implementing a custom index (currently just using the out of the box 'ExternalIndex') that somehow implements synonym searching in the analysis (via custom analyzer implementation etc - If that is even possible).
    • Manually formatting multiple search terms by checking for synonyms in the string beforehand, running all searches and consolidating the results after (really a nasty, last resort option - you don't have to tell me how bad this is, I already know).

    I have been trawling around the forums for a definitive answer on this and cannot really find one. Essentially I want to stick with the Examine engine for simplicity, however I am starting to think that the best way to achieve what I am after would be to move to a new engine completely (elastic search for example).

    Many thanks in advance.

  • Marc Goodson 1618 posts 10697 karma points MVP 6x c-trib
    Apr 17, 2021 @ 10:33
    Marc Goodson

    Hi WombledNumber1

    What kind of synonyms are you hoping to search with?

    Sometimes I'll add a multiple text field to documents in Umbraco to allow editors to supply 'synonyms' or other key terms that when searched for should match the particular document (and these terms are never displayed on the site, only added to Examine index and queried with a custom search filter.

    If it's common variations of a search term you want to return then you could get some success using Examine's Fuzzy method:

    The method takes a value between 0 and 1 for how closely a term should be matched, so a value of 0.8F is a good starting point, for matching common search terms to variations fo that word, eg Police matching Policeman...

    ... but that is different to true synonyms, eg matching 'fast' and 'quick'

    Examine is a wrapper around Lucene.Net

    So this article: might be useful for how this might be achievable with a custom analyzer in Examine.

    For really complex search scenarios, I'll often now push the content from Umbraco into an Azure Search index, that has support for synonyms and faceting baked in!

    (there's also a paid for package that pushes Examine into azure search, so that might be a quick way of handling this)



  • WombleNumber1 4 posts 85 karma points
    Oct 21, 2021 @ 15:37

    Thanks Marc - In the end the solution described on the following link that you suggested sufficed -

Please Sign in or register to post replies

Write your reply to: