I'm thinking of using Synonym Maps in Azure Search to improve search relevancy. I'm mostly looking at having acronyms to their expansions in the maps, Ex: AAD - Azure Active Directory, AKS - Azure Kubernetes Services, and so on. However there are some abbreviations that are duplicate like below: CSP - Cloud Service Provider, CSP - Content Security Policy, UDF - Universal Disk Format, UDF - User Defined Functions. In this case, is there a way to disambiguate the chosen synonym based on the context of the other words in search? Also will the text search be based on the entire phrase instead of the individual words - "User defined functions" being holistically matched for instead of "user", "defined", "functions" to bring up matches? Thanks.
Your expansion rule can map CSP to both Cloud Service Provider and Content Security Policy and then the documents that match either of those phrases will be returned.
{
"format":"solr",
"synonyms": "CSP, Cloud Service Provider, Content Security Policy\n"
}
If the issuer of the query provides more search terms to make it more selective, the search engine will rank higher the documents that matched more terms.
With this configuration searching for CSP
will map to the following search query:
search=CSP OR "Cloud Service Provider" OR "Content Security Policy"