A newer version of this documentation is available.

View Latest

Create a Custom Analyzer

  • how-to
    +
    Create a custom analyzer with the Couchbase Server Web Console to modify the input text from a Search query or Search index and improve search results.

    Prerequisites

    Procedure

    To create a custom analyzer with the Couchbase Server Web Console:

    1. Go to Search.

    2. Click the Search index where you want to create a custom analyzer.

    3. Click Edit.

    4. Expand Customize Index  Analyzers.

    5. Click Add Analyzer.

    6. In the Name field, enter a name for the new custom analyzer.

    7. To remove specific characters from search input before tokenizing, in the Character Filters list, do one of the following:

      1. To add a character filter to your analyzer, select a character filter and click + Add. You can select a default character filter or create your own.

      2. To remove a character filter from your analyzer, click remove.

    8. In the Tokenizer list, click the tokenizer you want to use to create tokens from Search input. You can select a default tokenizer or create your own.

      For more information, see Default Tokenizers or Create a Custom Tokenizer.

    9. To modify the tokens created by the tokenizer, in the Token Filters list, do one of the following:

      1. To add a token filter to your analyzer, select a token filter and click + Add. You can select a default token filter or create your own.

        For more information, see Default Token Filters or Create a Custom Token Filter.

      2. To remove a token filter from your analyzer, click remove.

    10. Click Save.

    Next Steps

    After you create a custom analyzer, you can set it as the default analyzer for your Search index.

    You can also use the custom analyzer when you Create a Type Mapping, Create a Child Mapping, and Create a Child Field.

    To continue customizing your Search index, you can also:

    To run a search and test the contents of your Search index, see Run A Simple Search with the Web Console or Run a Simple Search with the REST API and curl/HTTP.