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

Popular posts from this blog

SharePoint 2013 App Details Page Error

SharePoint 2013 - Working with Display Template for Content Search Web Part

Add spell check dictionary in SharePoint 2010, SharePoint 2013, and Office 365