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. For more information about analyzers, see customize-index.adoc#analyzers.
Prerequisites
-
You have the Search Service enabled on a node in your database. For more information about how to deploy a new node and Services on your database, see Manage Nodes and Clusters.
-
You have created an index. For more information, see Create a Basic Search Index with the Web Console.
-
You have logged in to the Couchbase Server Web Console.
Procedure
To create a custom analyzer with the Couchbase Server Web Console:
-
Go to Search.
-
Click the Search index where you want to create a custom analyzer.
-
Click Edit.
-
Expand
. -
Click Add Analyzer.
-
In the Name field, enter a name for the new custom analyzer.
-
To remove specific characters from search input before tokenizing, in the Character Filters list, do one of the following:
-
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.
For more information, see Default Character Filters or Create a Custom Character Filter.
-
To remove a character filter from your analyzer, click remove.
-
-
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.
-
To modify the tokens created by the tokenizer, in the Token Filters list, do one of the following:
-
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.
-
To remove a token filter from your analyzer, click remove.
-
-
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.