user7995357
user7995357

Reputation: 151

Azure Search synonyms not reflecting in results

The synonyms don't seem to function in Azure Search

I updated my synonyms map with the following payload {
"name" : "synonymmap1",
"format" : "solr",
"synonyms" :

"Bob, Bobby,Bobby\n
Bill, William, Billy\n
Harold, Harry\n
Elizabeth, Beth\n
Michael,Mike\n
Robert, Rob\n"

}

Then when I examined the synonymMap, I see this

{

"@odata.context": 
"https://athenasearchdev.search.windows.net/$metadata#synonymmaps",
"value": [
    {
        "@odata.etag": "\"0x8D4E7F3C1A9404D\"",
        "name": "synonymmap1",
        "format": "solr",
        "synonyms": "Bob, Bobby,Bobby\n\r\n    Bill, William, Billy\n\r\n    Harold, Harry\n\r\n    Elizabeth, Beth,Liza, Elize\n\r\n    Michael,Mike\n\r\n    Robert, Rob\n\r\n"
    }
]

}

However, the synonyms don't seem to function. e.g results for a search on Mike and Michael are not identical?

I understand this is a preview feature, but wanted help on the following

a) once defined as synonyms, should we not expect exact same results and search scores across all synonym variations

b) Can these synonyms apply at a column level (e. first name alone and not address)- or is it always across the document

c) if we have a large set of synonyms (over 1000)- does it lead to performance impact?

Upvotes: 2

Views: 569

Answers (1)

Nate Ko
Nate Ko

Reputation: 933

I am Nate from Azure Search. To answer the questions first :

a) Yes, you should. If "Bill" and "Williams" were defined as synonyms. Searching on either should yield the same result.

b) It's always at the column level. You use the field/column property called 'synonymMaps' to specify which synonym maps to use. Please see "Setting the synonym map in the index definition" in https://azure.microsoft.com/en-us/blog/azure-search-synonyms-public-preview/ for more information.

c) Do you mean over 1000 synonyms for a word? or 1000 synonym rule in the synonym map? The former definitely impacts performance because the search query will expand to 1000 of terms. In fact, you can't define more than 50 synonyms in a rule. The latter, 1000s of rules in a synonym map shouldn't impact performance unless the rules are constantly updated.

Regarding your comments that synonyms don't function, based on your questions, I was wondering if the synonyms feature was enabled in the index definition. Could you check that and if it doesn't function, feel free to drop me an email at [email protected].

The extraneous new line characters you see in the retrieved synonym map may have been inserted by the http client you were using at the time of uploading. Some http clients, fiddler and postman for example, insert new line character at the line ending automatically so you don't have to do it yourself.

Thanks,

Nate

Upvotes: 4

Related Questions