Indexes

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

      Indexes are used by certain services, such as Query, Analytics, and Search, as targets for search-routines. Each index makes a predefined subset of data available for the search.

      The Query service relies on indexes provided by the Index service. The Search and Analytics services both provide their own indexes, internally.

      Indexes, when well-designed, provide significant enhancements to the performance of search-operations.

      Indexes

      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 collection. 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 primary indexes, see Using Indexes.

      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 SQL++. For information on Global Secondary Indexes, see Using Indexes.

      Search

      Provided by the Search Service, this is a specially purposed index, which contains targets derived from the contents of documents within one or more specified keyspaces. Search indexes support text matching, geospatial, date-time, numeric range searches, and more. For text matching, you can add filters to remove undesirable characters from input and target text values, such as punctuation marks or HTML tags. For information on how to create Search indexes, see Create a Search Index.

      Vector Search

      Provided by the Search Service, this is a type of Search index which supports vector embeddings. Use Vector Search indexes to run searches with the Search service using vector comparisons. You can use Vector Search indexes for Retrieval Augmented Generation (RAG) with an existing Large Language Model (LLM). To create Vector Search indexes, see Create a Vector Search Index with the Server Web Console or Create a Vector Search Index with the REST API and curl/HTTP.

      Analytics

      Provided by the Analytics Service, this is a materialized access path for the shadow data in an Analytics collection. Analytics indexes can be used to speed up Analytics selection queries and join queries. If changes in operational data result in corresponding modifications to shadow data, Analytics indexes are updated automatically. See the section on Using Indexes in Couchbase Analytics.

      View

      Supports Couchbase Views, with fields and information extracted from documents. Views are deprecated in Couchbase Server 7.0, and will be removed in a future release.