A newer version of this documentation is available.

View Latest

Creating Indexes

      +
      Full Text Searches are executed using FTS indexes. The Couchbase Search service creates and manages the FTS index. FTS indexes can be created or updated via the Couchbase Web Console, the REST API (e.g. using curl), or the Couchbase SDKs. The Search service also runs the search queries.

      The search service exposes a set of REST apis to create and search FTS indexes. All of the create and search FTS index operations from UI and SDK use the REST APIs exposed by the search. See the details of the search REST API here: https://docs.couchbase.com/server/current/rest-api/rest-fts.html

      Each index has a unique UUID assigned to it. When you rebuild the index, speficy the existing UUID. A matching uuid is required to rebuild an index. Upon a successful index creation/updation, the uuid of the index will be re-initialized.

      Every Full Text Search is performed on a Full Text Index, which contains the stemmed words and values on which searches are to be performed. Compared to GSI indexes, FTS indexes are highly configurable; You can analyze the data for specific languages, analyzers, character filters, ngrams, etc. This is so because the needs are of the search is different because search focuses on language where as GSI focuses on the values irrespective of the language.

      These are the high level configuration for each index:

      If you have multiple types of document in a single collection (default or named), the documents can be grouped into different types. You can also group the documents based on patterns in the document keys. This allows you to group the documents into different sets.

      For the analysis of data to create the index, you can do the following: * Assign index mapping to each document type

      • Assign analyzers to each index mapping

      • Apply the index mapping to a specific subset of document fields

      • Included or exclude the index mapping from the index

      Once you create the indexes, you can use them in multiple way to meet your application objectives. You can create a single index to include data from one or more collections from a single scope; You can use aliases to logically represent a grouping of multiple indexes.