Fuzzy Search in the Search API - azure

The Azure search api offers a fuzzy paramter for suggestions. like this:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&fuzzy=true&search=berlen
Would return "Berlin" as a result of berlen.
I can't find a documentation about this how to activate it in a normal search
setting there fuzzy = true seems to not change anything
https://blssuggestions.search.windows.net/indexes/cities/docs?api-version=2015-02-28&search=berlen&fuzzy=true

[Update]: Please see the other responsed about using querytype=full as this response is no longer correct.
This is correct. Fuzzy search is only available currently in the suggestions api.

You need to call:
https://blssuggestions.search.windows.net/indexes/cities/docs/suggest?api-version=2015-02-28&suggesterName=default&queryType=full&search=berlen~
You were missing querytype=full and the tilde after the character that you want to execute fuzzy searches on.

This is now in the preview version of the api:
https://{yourSite}.search.windows.net/indexes/{yourIndex}/docs?search={fieldToSearch}:{lookupValue}~&queryType=Full&api-version=2015-02-28-preview
Note the ~ and queryType=Full, both of which are required to force fuzzy matching.
Documentation is here:
https://msdn.microsoft.com/library/azure/mt589323.aspx
CAVEAT: The fuzzy search is very fuzzy! i.e. dog will match any 3 letter word with only a single matched letter - dim, now, bag
I am trying to figure out how to tune and tweak but as it is still in preview the documentation is sparse.
UPDATE: I just re-read the documentation and it has since been updated with details of an optional distance parameter. I will investigate.

Related

Is there any option available in Azure Search for spell check?

I am using azure search in my bot application.
In this if we give input with spelling mistake, for small words like trvel => travel we are getting response properly.
But if i enter "travelexpense" for this i am not getting any result.
Currently i am passing input to do fuzzy search.
I have suggested to use Bing Spell Check API, but it is not approved as they think our input may be stored outside.
Is there any option available in azure search to correct the words like "travelexpense".
Is there any option available for this scenario?
The closest I would say is a phonetic Analyzer.
https://learn.microsoft.com/en-us/azure/search/index-add-custom-analyzers
There a couple of other things you can try:
Enable Auto Complete and Suggestions (https://learn.microsoft.com/en-us/azure/search/search-autocomplete-tutorial)
Create synonyms (https://learn.microsoft.com/en-us/azure/search/search-synonyms)

Verbatim search in azure/cognitive/bing web search (API, not website)

I cannot find any option to achieve a verbatim azure/cognitive/bing Web search.
In my case the difference is trying to sift through tens of millions of irrelevant search results to find the 10 results that actually match my query literally.
Even though I am a paying customer, there is no support available. And the API documentation did not help either.
I would think it should be super easy to provide a verbatim search option. Is there one that I did not see?
I checked further and it seems for the Bing Search APIs - +"phrase" works and returns documents containing this phrase at the top. Just add + in front of what you have been trying. Support link is here: https://azure.microsoft.com/en-us/support/plans/.

Azure search, search by partial terms

Here are two examples for search in the portal, where I would expect to get some results in the second search, even with one letter missing.
The search is in Hebrew language
The full term return some results,
The same term with one letter missing return no results,
There are a few ways you can search for partial terms in Azure Search. You'll need to decide which of the following methods will work best in your scenario. Based on the example it seems either fuzzy search or prefix search will do the job. You can learn about the differences between the these methods in the documentation.
Fuzzy search: blog, documentation
Wildcard search, specifically prefix search: documentation
Regular expression search: documentation
Index partial terms by defining a custom analyzer: blog, documentation
Let me know if you have any questions about any of the above
Check this answer I solve this using a regex and change the GET by a POST request.

Azure Search Spell mistake handling

My application is in MVC and I have a search text box based on azure index, its working fine however I have a scenario where in if I enter "chres Harris" instead of "chris Harris" it should return result "chris Harris" but it returns different result like "bob Harris" and then "chris harris", I want the results to be nearabout the same even if there is a spell mistake, please help will any index scoring profile, parameter boost or something useful ?
As of now there are two ways you can handle spelling mistakes in Azure Search.
Use fuzzy queries with Lucene query language. You can boost relevance of exact matches over fuzzy matches for example, search=term^2 OR term~2.
If you deal with names of things, like in your example, configure your index to support phonetic search. Different boosting options to influence relevance are described in the article.
Let me know if none of them don't works for you.

Exact match in google search

I am trying to make an application which find all the copied code in a project.
But basically my question is purely related to google search.
I made a search for the keyword "public void bubbleSort(int[] arr){"
and this was the result.
In the first page of search results, only the last url makes a perfect match with my keyword.
Can i tell google with some search keywords so that it will give more importance to pages with an exact match of my search keyword?
although the plus sign, +, is no longer an available Google search filter, you can use quotes, or after running the query selecting Search Tools and then verbatim under the All Results drop down.
You can also search the Google code archives, https://code.google.com/ or try some of the other code search engines around the Internet.
+"public void bubbleSort(int[] arr){"
the plus sign means to include this term no matter what. the quotes turn the loosely coupled words into a single term.
for a full list of Google syntax operators:
[web]: https://support.google.com/websearch/answer/136861?hl=en

Resources