Create a Custom Analyzer

  • Capella Operational
  • how-to
    +
    Create a custom analyzer with the Couchbase Capella UI’s Advanced Mode to modify the input text from a Search query or Search index and improve search results.
    You must use Advanced Mode to add a custom analyzer to your Search index. For more information, see Create a Basic Search Index in Advanced Mode.

    For more information, see Search Index Features.

    Prerequisites

    • You have the Search Service enabled on a node in your cluster. For more information about how to change Services on your cluster, see Modify a Paid Cluster.

    • You have created an index with Advanced Mode.

    • You have logged in to the Couchbase Capella UI.

    Procedure

    To create a custom analyzer with the Capella UI in Advanced Mode:

    1. On the Operational Clusters page, select the cluster that has the Search index you want to edit.

    2. Go to Data Tools  Search.

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

    4. Under Advanced Settings, expand Analyzers.

      Make sure you use Advanced Mode.
    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, click a character filter. You can select a default character filter or create your own.

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

    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, click a token filter. 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 the x on a token filter.

    10. Click Submit.

    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 with Advanced Mode, a child mapping or 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 Capella UI.