Full Text Search: Fundamentals
Full Text Search (FTS) lets you create, manage, and query specially purposed indexes, defined on JSON documents within a Couchbase bucket.
Features of Full Text Search
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.
Full Text Search is powered by Bleve, an open source search and indexing library written in Go. Full Text Search uses Bleve for the indexing of documents, and also makes available Bleve’s extensive range of query types. These include:
- Match, Match Phrase, Doc ID, and Prefix queries
- Conjunction, Disjunction, and Boolean field queries
- Numeric Range and Date Range queries
- Geospatial queries
- Query String queries, which employ a special syntax to express the details of each query (see Query String Query for information)
Full Text Search also includes Bleve’s general-purpose text analyzers, as well as pre-built text analyzers for the following languages: Arabic, English, French, German, Hindi, Italian, Persian, Portuguese, Sorani, and Spanish. Additionally, Full Text Search scores documents by means of Bleve’s industry standard tf-idf scoring, with query time boosting.
What's New in this Release
The following features have been added, as part of the 5.0 release of Couchbase Server:
- Support for Multi-Node Setups. Within a Couchbase Server-cluster, Full Text Indexes now work over multiple nodes that have the Search service enabled. Such indexes are automatically distributed into fragments called pindexes (partitioned indexes): this being similar to the way in which buckets are physically distributed across Couchbase nodes that are running the data service.
- Dynamic Topology Support. Full Text Search not only runs on more than one Full Text Search node, but also continues to work during topology changes. For example, adding or removing nodes running the Search service results in pindexes being correspondingly moved to or from those nodes. Full Text Search indexes can also be replicated, for enhanced availability.
- Partial Results Queries. Every search returns the number of pindexes that succeeded, along with the search hits from those indexes, merged and sorted into a single result-set, thus providing a fault tolerance mechanism: the application developer has the option of using partial rather than full result-sets, if some pindexes fail to respond before timeout, or respond with an error.
- Enhanced Indexing Performance. Full Text Search indexing-speed is considerably enhanced, due to increased memory-efficiency.
- Support for Role Based Access Control (RBAC).
- Audit Logging. Full Text Search activities now appear in audit logs.
- Extended Statistics on Full Text Search indexing and querying are now provided.
Authorization for Full Text Search
To access Full Text Search, users require appropriate roles. The role FTS Admin must therefore be assigned to those who intend to create indexes; and the role FTS Searcher to those who intend to perform searches. For information on creating users and assigning roles, see Authorization.