You are viewing the documentation for a prerelease version.

View Latest

Search Service

The Search Service supports the creation of specially purposes indexes for Full Text Search.

Search represents Full Text search. The indexes that it creates and uses are entirely separate from and different to those of the Index Service. Full Text Search provides extensive capabilities for natural-language querying. These include:

  • Language-aware searching; allowing users to search for, say, the word beauties, and additionally obtain results for beauty and beautiful.

  • Scoring of results, according to relevancy; allowing users to obtain result-sets that only contain documents awarded the highest scores. This keeps result-sets manageably small, even when the total number of documents returned is extremely large.

  • Fast indexes, which support a wide range of possible text-searches.

Search Service Architecture

The Search Service requires the Data Service, but does not require, and has no relation to the Index Service. This service can also be invoked now via the query service.

searchServiceArchitecture

The illustration depicts the following:

  • Data Service: Uses the DCP protocol to stream data-mutations as batches from the producer to multiple consumers instantiated across the search nodes.

  • Search Service: When a search index is created, the number of partitions chosen for the index directly represents the number of DCP consumers created across all search nodes. Each index partition covers a certain number of the bucket partitions. For example, if the number of bucket partitions is 120 (vbuckets), and the number of index partitions chosen is 6, each index partition holds data from 20 vbuckets.

    Any of the available search nodes in the cluster are searchable. When one of the many nodes is chosen for a search request, it takes up the role of a coordinator and is responsible for applying the search request to the other nodes where search data resides within the cluster. It then gathers results from all the partitions on all the nodes, applies any filters on them and returns the hits back to the user.

searchServiceOperation

The illustration depicts the scatter-gather execution of a search request by the search service:

  • The search node that the search request (from an application/user) targets within a couchbase cluster assumes the role of a coordinator.

  • The coordinator then scatters the search request to all the index partitions which could be local and remote.

  • Once all the requested data is gathered from all the index partitions, the coordinator returns the hits to the application/user after applying any filters/settings specified within the search request.

For extensive details on how to use the service, see Full Text Search: Fundamentals.