A newer version of this documentation is available.

View Latest

Search Service Quick Start Guide

      Following appropriate preparations, full text searches can be performed in a number of ways.


      The user interface for Full Text Search is provided by the Couchbase Web Console.

      • Ensure that Couchbase Server has the Search service appropriately enabled. The service must be enabled for a given node as part of that node’s initial configuration. Refer to Create a Cluster for information.

      • You must have permission to log into the console, load sample data, create indexes, create search indexes, and perform searches. For information on Role-Based Access Control, see Authorization.

      • The example(s) provided assume that you have can load or have loaded the travel-sample dataset. You will perform your Search operations on the data under this bucket. For instructions on how to load this sample dataset, see Sample Buckets.

      • The Couchbase Web Console by accessing http://localhost:8091 or if remote http://${CB_HOSTNAME}:8091 where CB_HOSTNAME is an environment variable set to a FQDN or an IP address for a node on your Couchbase cluster.

      Quick Start via the Classic Editor

      To quickly become familiarized with the Search service, try one of the step by step index creation (and query) examples against the travel-sample sample dataset:

      • Collections

      • Bucket Compatibility

        • Creating a Legacy Index via the UI (or via the REST API), followed by a sample Search query.

          The above Legacy Index is used for compatibility after an upgrade from buckets to collections uses the old bucket style "default _mapping which only works on the default scope and _default collection where buckets are upgraded into. The preferred method as of version 7.0 is shown in Creating a Dynamic Index above.

      For a more detailed explanation of the available index creation, including index creation by means of the Couchbase REST API, refer to Creating Search Indexes.

      To install the travel-sample sample dataset, refer to Install Sample Buckets with the UI .

      For a more detailed explanation of the available Query options, refer to Searching from the UI

      During index creation, in support of most query-types, you can select (or create) and use an analyzer. This is optional: if you do not specify an analyzer, a default analyzer is provided. Analyzers can be created by means of the Couchbase Web Console, during index creation, as described in Creating Search Indexes. Their functionality and inner components are described in detail in Understanding Analyzers.

      Methods to Access the Search service

      Search queries (Full Text, Geospatial, Numeric, and other) can be performed with:

      • The Couchbase Web Console. This UI can also be used to create indexes and analyzers. Refer to Searching from the UI for information.

      • The Couchbase REST API. Refer to Searching with the REST API for information. Refer also to Search API for REST reference details.

      • The Couchbase SDK. This supports several languages, and allows Search queries to be performed with each. Refer to the SDK’s Java Search Overview page for information. Note that the Searching from the Java SDK page for the Java SDK provides an extensive code-example that demonstrates multiple options for performing searches.

      • The N1QL Search functions. These enable you to perform a Search queries as part of a SQL++ (or N1QL) query. Refer to Search Functions for information.

      Accessing the Search service via the Java SDK

      The Java SDK code-example provided in Searching from the Java SDK contains multiple demonstration calls — each featuring a different query-combination — and makes use of three different index-definitions, related to the travel-sample bucket: for the code example to run successfully, the three indexes must be appropriately pre-established. Instructions on how to use the Couchbase REST API to establish the definitions refer to Index Creation with REST API.