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 appropriately enabled. Enablement for a given node must occur as part of that node’s configuration. See Initializing the 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, see Searching from the UI. For a more detailed explanation of the available options, including index-creation by means of the Couchbase REST API, see 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.
Full Text Searches can be performed with:
The Couchbase Web Console. This UI can also be used to create indexes and analyzers. See Searching from the UI, for information.
The Couchbase SDK. This supports seven languages, and allows Full Text Searches to be performed with each. See the SDK’s java-sdk::common/full-text-search-overview.adoc page, for information. Note also 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. (See immediately below for more information.)
The Java SDK code-example provided in Searching with 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.
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.