Custom Analyzer Tutorial
This sample creates a search index and builds a custom analyzer designed for handling phone numbers. Phone numbers are a good candidate for custom analyzers due to the multiple formats and special characters that exist for this type of content. The HTTP requests step through the process of testing sample searches, testing lexical analysis, and building an analyzer to intuitively search phone numbers.
This sample is featured in the Tutorial: Create a custom analyzer using REST APIs.
Prerequisites
Visual Studio Code with a REST client.
Azure AI Search. Create or find an existing Azure AI Search resource under your current subscription.
Get connection information
Gather connection information used on the requests. You can find this information in the Azure portal. Save it in Notepad or another temporary location.
In Azure portal, get the search service endpoint (for example,
https://demo-svc.search.windows.net
).Next, select Keys on the left and copy one of admin keys.
Set up variables
Clone or download this sample repository.
Open
custom-analyzers.rest
in Visual Studio Code. If you need help with Visual Studio Code setup, see Quickstart: Text search using REST.Paste in the variables you collected earlier:
- In
@baseUrl
, enter the search endpoint. - In
@apiKey
, enter the admin API key of your search service.
- In
Run the code
For each request, select Send request.
For an explanation of the code, see Tutorial: Create a custom analyzer using REST APIs.