You are viewing the documentation for a prerelease version.

View Latest

Performing Searches

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

Preparing for Full Text Searches

Before attempting a full text search, you must:

  • 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 configuration. Refer to Create a Cluster for 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.

Note that 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.

Performing Full Text Searches

Full text searches can be performed with:

Establishing Demonstration Indexes

The Java SDK code-example provided in java-sdk::full-text-searching-with-sdk.adoc 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. The definitions are provided in Demonstration Indexes. Instructions on how to use the Couchbase REST API to establish the definitions are provided in the section Index-Creation with the REST API, on the page Creating Indexes.