Skip to content

Commit 1b06f81

Browse files
authored
Merge pull request #202646 from HeidiSteen/heidist-support-case
[azure search] Edits to fuzzy search doc
2 parents 2c42f14 + 77a06d6 commit 1b06f81

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/search/search-query-fuzzy.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,37 +45,37 @@ Collectively, the graphs are submitted as match criteria against tokens in the i
4545
4646
## Indexing for fuzzy search
4747

48-
Make sure the index includes text fields that are conducive to fuzzy search, such as names, categories, descriptions, or tags.
48+
String fields that are attributed as "searchable" are candidates for fuzzy search.
4949

50-
Analyzers aren't used to create an expansion graph, but that doesn't mean analyzers should be ignored in fuzzy search scenarios. Analyzers are important for tokenization during indexing, where tokens are used for both full text search and for matching against the graph.
50+
Analyzers aren't used to create an expansion graph, but that doesn't mean analyzers should be ignored in fuzzy search scenarios. Analyzers are important for tokenization during indexing, where tokens in the inverted indexes are used for matching against the graph.
5151

52-
As always, if test queries aren't producing the matches you expect, you could try varying the indexing analyzer, setting it to a [language analyzer](index-add-language-analyzers.md), to see if you get better results. Some languages, particularly those with vowel mutations, can benefit from the inflection and irregular word forms generated by the Microsoft natural language processors. In some cases, using the right language analyzer can make a difference in whether a term is tokenized in a way that is compatible with the value provided by the user.
52+
As always, if test queries aren't producing the matches you expect, experiment with different indexing analyzers. For example, try a [language analyzer](index-add-language-analyzers.md) to see if you get better results. Some languages, particularly those with vowel mutations, can benefit from the inflection and irregular word forms generated by the Microsoft natural language processors. In some cases, using the right language analyzer can make a difference in whether a term is tokenized in a way that is compatible with the value provided by the user.
5353

54-
## How to use fuzzy search
54+
## How to invoke fuzzy search
5555

56-
Fuzzy queries are constructed using the full Lucene query syntax, invoking the [full Lucene query parser](https://lucene.apache.org/core/6_6_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html).
56+
Fuzzy queries are constructed using the full Lucene query syntax, invoking the [full Lucene query parser](https://lucene.apache.org/core/6_6_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html), and appending a tilde character `~` after each whole term entered by the user.
57+
58+
Here's an example of a query request that invokes fuzzy search. It includes four terms, two of which are misspelled:
5759

5860
```http
5961
POST https://[service name].search.windows.net/indexes/hotels-sample-index/docs/search?api-version=2020-06-30
6062
{
61-
"search": "seatle~2",
63+
"search": "seatle~ waterfront~ view~ hotle~",
6264
"queryType": "full",
6365
"searchMode": "any",
64-
"searchFields": "HotelName, Address/City",
65-
"select": "HotelName, Address/City,",
66+
"searchFields": "HotelName, Description",
67+
"select": "HotelName, Description, Address/City,",
6668
"count": "true"
6769
}
6870
```
6971

7072
1. Set the query type to the full Lucene syntax (`queryType=full`).
7173

72-
1. Optionally, scope the request to specific fields, using this parameter (`searchFields=<field1,field2>`).
73-
74-
1. Provide the query string. An expansion graph will be created for every term in the query input. Append the tilde (`~`) operator at the end of each whole term (`search=<string>~`).
74+
1. Provide the query string where each term is followed by a tilde (`~`) operator at the end of each whole term (`search=<string>~`). An expansion graph will be created for every term in the query input.
7575

7676
Include an optional parameter, a number between 0 and 2 (default), if you want to specify the edit distance (`~1`). For example, "blue~" or "blue~1" would return "blue", "blues", and "glue".
7777

78-
In Azure Cognitive Search, besides the term and distance (maximum of 2), there are no other parameters to set on the query.
78+
Optionally, you can improve query performance by scoping the request to specific fields. Use the `searchFields` parameter to specify which fields to search. You can also use the `select` property to specify which fields are returned in the query response.
7979

8080
## Testing fuzzy search
8181

0 commit comments

Comments
 (0)