2
votes

Need help with the query to combine proximity search and fuzzy search in Azure. Index has items below:

  1. University of Washington
  2. University of Mary Washington Foundation
  3. Washington Adventist University

Search term: Universty of Washington - (University misspelled)

This should return record 1. i.e Fuzzy matching on University and Proximity match on rest of the words.

1

1 Answers

0
votes

From the Azure Search documentation:

Fuzzy Search

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".

Proximity Search

Insert a tilde "~" symbol at the end of a phrase followed by the number of words that create the proximity boundary. For example, "hotel airport"~5 will find the terms "hotel" and "airport" within 5 words of each other in a document.

Based on this documentation, I can construct a query that combines fuzzy and proximity search

“Universty~ of~ Washington~”~5 

Note that you must use Lucene query syntax for this to work