1
votes

I have an index set up with about 1000 items in it. I am doing the following API call to get the results back.

        var parameters = new SearchParameters
        {
            Select = new[] { "pageTitle", "pageUrl", "metaDescription" },
            Top = 5,
            QueryType = QueryType.Full
        };
        var results = indexer.Documents.Search<IndexPageData>("childrens bed frames~", parameters);

It's working as expected from a getting data back point of view. But if I misspell 'Childrens' with something like 'Childrns' or 'Chidrens'... Was I under the impression the fuzzy/mis-spellings search would understand and return the same results or very similar?

But I get completely different results and they are very poorly matched compared to the correctly spelled term.

Am I missing something with the API?

2
I think it's probably a grammar issue (key word here being single): To do a fuzzy search, use the tilde "~" symbol at the end of a single word with an optional parameter, a number between 0 and 2 (default), that specifies the edit distance. For example, "blue~" or "blue~1" would return "blue", "blues", and "glue". Fuzzy search can only be applied to terms, not phrases. Fuzzy searches can expand a term up to the maximum of 50 terms that meet the distance criteria. docs.microsoft.com/en-us/rest/api/searchservice/…Aaron
I am using the tilde with the default value, which is 2? But misspellings tend to be mixed up letters or .. ie .. ei or missing letters... I was under the impression Azure search handled things like this?leen3o
Search only "chldren~" ... it should work. You have 3 words in your string.Aaron
Or, try "childrn~ bed~ frames~" maybe... It's definitely grammar. I'm not at my desk, but you should be able to search for an example.Aaron
Do you mind if I create an answer based on comments?Aaron

2 Answers

2
votes

As per the comment from Aaron. I was missing the tilda at the end of each word

childrens~ bed~ frames~

This is now catching things like "childrn bed frames" etc...

0
votes

"Fuzzy" Search is currently only available for the suggester, see this. You will have to rely on your language analyser to properly tokenize the word and provide you with the expected result.