Azure AI Search filter or search with case insensitive
In case that you have a search index field that was created already and couldn't perform the text normalization to allow default search/filter with case insensitive. You can have another option if your field is set to searchable.
You can use search.ismatch function provided by Azure Cognitive Search to perform a match operation on the specific field.
Sample syntax for putting in the SearchOptions will be something like
SearchOptions options = new SearchOptions {
Size = 50,
Filter = $"search.ismatch('{url}', 'url', 'simple', 'all')"
};
The parameters for ismatch:
- the actual URL to match
- the name of the index field
- 'simple' is specifying t he analyzer to use. The simple analyzer is a basic text analyzer that breaks text into terms based on whitespace and punctuation.
- 'all' specifies the search mode. The all mode means all of the terms in teh query must match
Reference:
- https://learn.microsoft.com/en-us/azure/search/search-query-odata-full-text-search-functions
Comments