Share via

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

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.

  1. In Azure portal, get the search service endpoint (for example, https://demo-svc.search.windows.net).

  2. Next, select Keys on the left and copy one of admin keys.

Set up variables

  1. Clone or download this sample repository.

  2. Open custom-analyzers.rest in Visual Studio Code. If you need help with Visual Studio Code setup, see Quickstart: Text search using REST.

  3. Paste in the variables you collected earlier:

    • In @baseUrl, enter the search endpoint.
    • In @apiKey, enter the admin API key of your search service.

Run the code

  1. For each request, select Send request.

  2. For an explanation of the code, see Tutorial: Create a custom analyzer using REST APIs.