A newer version of this documentation is available.

View Latest


    Couchbase Server indexes enhance the performance of query and search operations.


    The following forms of index are available:

    • Primary: Provided by the Index Service, this is based on the unique key of every item in a specified bucket. Every primary index is maintained asynchronously. A primary index is intended to be used for simple queries, which have no filters or predicates. For information on creating a primary index, see CREATE PRIMARY INDEX.

    • Secondary: Provided by the Index Service, this is based on an attribute within a document. The value associated with the attribute can be of any type: scalar, object, or array.

      A Secondary Index is frequently referred to as a Global Secondary Index, or GSI. This is the kind of index used most frequently in Couchbase Server, for queries performed with the N1Ql query-language.

    • Full Text: Provided by the Search Service, this is a specially purposed index, which contains targets derived from the textual contents of documents within one or more specified buckets. Text-matches of different degrees of exactitude can be searched for. Both input and target text-values can be purged of irrelevant characters (such as punctuation marks or html tags). For information on how to create Full Text Indexes, see Creating Indexes.

    • View: Supports Couchbase Views, with fields and information extracted from documents.

    • Shadow Data Set: Provided by the Analytics Service, this is linked to operational data, so that changes in operational data result in corresponding modifications to shadow data, in real time. The shadow data can then be queried by the Analytics Service directly. See the Introduction to Couchbase Analytics.