locked
Fuzzy search and synonyms at same time RRS feed

  • Question

  • Hello!

    I have synonyms map. It is assigned to some field and working well.

    But when I am using Lucene search syntax and trying to implement fuzzy search synonyms are not found.

    For example I have map with "hotel, model"

    When I am searching for "motel~" I can't find records with "hotel" inside. May be there is some special hidden setting that I can use?

    Friday, July 6, 2018 6:19 AM

Answers

All replies

  • Hello,

     

    Unfortunately, Synonym expansions do not apply to wildcard search terms; prefix, fuzzy, and regex terms aren't expanded.

    Learn more here - https://docs.microsoft.com/en-us/azure/search/search-synonyms#impact-of-synonyms-on-other-search-features

     

    Thanks,

    Nati


    Friday, July 6, 2018 8:17 PM
  • Hi again,

    Please consider the following as a possible workaround in your case.
    Synonyms only apply to term or phrase queries. However, as an application developer, you have the full control of how the query gets passed in to the service. For example, given a query x from the user, you can rewrite it with both term and fuzzy queries, x OR x~. In this case, the former term query will expand to include synonyms, the latter fuzzy query will expand to include typos of the original query.

    I hope this helps,

    Nati


    Monday, July 9, 2018 5:50 PM