Search Service Quickstart Guide
Following appropriate preparations, full text searches can be performed in a number of ways.
Before attempting a full text search, you must:
Ensure that Couchbase Server has the Search service enabled for at least one node in the cluster. The service must be enabled for a node’s configuration. Refer to Create a Cluster for more information.
Create an appropriate index. This can be accomplished by means of the Couchbase Web Console. For a simple example of index creation, which allows you to get started quickly, refer to Searching from the UI. For a more detailed explanation of the available options, including index creation by means of the Couchbase REST API, refer to Creating Indexes.
|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 Indexes. Their functionality and inner components are described in detail in Understanding Analyzers.
Full text searches 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 SDK. This supports several languages, and allows full text searches to be performed with each. Refer to the SDK’s Full Text Search page for information. Note that the Searching from the SDK page for the Java SDK provides an extensive code-example that demonstrates multiple options for performing full text searches.
The N1QL Search functions. These enable you to perform a full text search as part of a N1QL query. Refer to Search Functions for information.
The Java SDK code-example provided in Searching from the 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 Creating Index with REST API.