ScyllaDB University LIVE, FREE Virtual Training Event | March 21
Register for Free
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Manual Features Full-Text Search in ScyllaDB

Caution

You're viewing documentation for an unstable version of ScyllaDB Manual. Switch to the latest stable version.

Full-Text Search in ScyllaDB¶

What Is Full-Text Search¶

Full-Text Search (FTS) lets you find rows that contain specific words or phrases inside text columns. Unlike exact-match queries or LIKE filters, FTS uses an inverted index to tokenize text and rank results by relevance using the BM25 scoring algorithm.

Typical use cases include:

  • Searching for keywords in product descriptions, articles, or log messages

  • Ranking results by how well they match a search query

  • Filtering rows that contain at least one matching term

Creating a Full-Text Index¶

Before you can run FTS queries, you must create a fulltext_index on the target column:

CREATE CUSTOM INDEX ON ks.t (v) USING 'fulltext_index';

You can specify an analyzer to control how text is tokenized:

CREATE CUSTOM INDEX ON ks.t (v) USING 'fulltext_index'
    WITH OPTIONS = {'analyzer': 'english'};

Requirements:

  • The indexed column must be of type text, varchar, or ascii. Other types are rejected.

  • The indexed column must be a regular or clustering-key column. Partition-key columns cannot be indexed.

  • The table must use tablets (not vnodes).

  • CDC must be enabled on the table with a TTL of at least 86400 seconds (24 hours) and either delta = 'full' or postimage enabled. CDC is enabled automatically when creating a fulltext index, so you do not need to configure it manually.

Querying with BM25¶

FTS queries use the BM25() function to score rows against a search term. BM25() takes two arguments: a column name and a query string.

A full-text search query must use BM25() in both of these clauses, on the same column:

  • A WHERE clause of the exact form BM25(column, 'term') > 0 to filter the rows that match the search term.

  • An ORDER BY BM25(column, 'term') clause to rank the matching rows by their BM25 relevance score (highest first).

Neither clause works on its own - a query with only WHERE BM25() or only ORDER BY BM25() is rejected, and both must reference the same column and the same search term. Every FTS query also requires a LIMIT.

For the full syntax reference, see Full-Text Search queries (BM25).

Basic query¶

Filter the rows that contain the search term and rank them by relevance:

SELECT * FROM ks.t
    WHERE BM25(v, 'search term') > 0
    ORDER BY BM25(v, 'search term')
    LIMIT 10;

In the WHERE clause, > is the only supported operator and the right-hand side must be the literal 0. Operators such as >=, =, <, <=, and != are rejected, as is any non-zero threshold.

Filtering support¶

Additional WHERE restrictions (such as partition key equality) are not currently supported alongside BM25() and will be rejected. Support for combined filtering is planned for a future release.

Using bind markers¶

The query term can be supplied with a bind marker in prepared statements:

SELECT * FROM ks.t
    WHERE BM25(v, ?) > 0
    ORDER BY BM25(v, ?)
    LIMIT 10;

Disambiguating from a user-defined function¶

BM25 is not a reserved word. If a keyspace defines a user-defined function named bm25, an unqualified BM25() call becomes ambiguous; qualify the built-in operator as system.bm25(...) to select it explicitly.

Unsupported ScyllaDB Features¶

Full-text indexes do not support all ScyllaDB features. The following features are not supported when using Full-Text Search:

  • Tracing

  • TTL (Time To Live)

  • Paging

  • Grouping (GROUP BY)

Query Constraints¶

FTS queries enforce the following rules:

Constraint

Details

Both clauses required

A query must include both a WHERE BM25() > 0 filter and an ORDER BY BM25() ranking. Both must reference the same column and the same search term. Neither clause is accepted on its own.

> and literal 0 only

In WHERE, the only accepted form is BM25(column, 'term') > 0. Other operators (>=, =, <, <=, !=) and non-zero thresholds are rejected.

Filtering support

Only BM25(column, 'term') > 0 is accepted in WHERE. Any additional restriction (e.g., a partition key equality) is rejected. Combined filtering is planned for a future release.

LIMIT is required

Every FTS query must include a LIMIT clause. Queries without LIMIT are rejected.

PER PARTITION LIMIT not supported

PER PARTITION LIMIT cannot be used with FTS queries.

Aggregation not supported

FTS queries cannot include aggregate functions (e.g., COUNT(*), SUM()).

Fulltext index required

The queried column must have a fulltext_index. A regular secondary index does not satisfy this requirement.

BM25() cannot appear in SELECT

BM25() is only valid in WHERE and ORDER BY clauses, not as a selector.

Partition key columns excluded

A fulltext_index cannot be created on a partition key column, so BM25() cannot target one. Regular and clustering-key text columns are supported.

Single ordering only

ORDER BY BM25() cannot be combined with other ORDER BY columns, a second BM25() ordering, or with ANN ordering.

Was this page helpful?

PREVIOUS
Vector Search in ScyllaDB
NEXT
ScyllaDB Architecture
  • Create an issue
  • Edit this page

On this page

  • Full-Text Search in ScyllaDB
    • What Is Full-Text Search
    • Creating a Full-Text Index
    • Querying with BM25
      • Basic query
      • Filtering support
      • Using bind markers
      • Disambiguating from a user-defined function
    • Unsupported ScyllaDB Features
    • Query Constraints
ScyllaDB Manual
Search Ask AI
  • master
    • master
    • 2026.2
    • 2026.1
    • 2025.4
    • 2025.3
    • 2025.2
    • 2025.1
  • Getting Started
    • Install ScyllaDB 2026.2
      • Launch ScyllaDB 2026.2 on AWS
      • Launch ScyllaDB 2026.2 on GCP
      • Launch ScyllaDB 2026.2 on Azure
      • ScyllaDB Web Installer for Linux
      • Install ScyllaDB 2026.2 Linux Packages
      • Run ScyllaDB in Docker
      • Install ScyllaDB Without root Privileges
      • Air-gapped Server Installation
      • ScyllaDB Housekeeping and how to disable it
      • ScyllaDB Developer Mode
    • Configure ScyllaDB
    • ScyllaDB Configuration Reference
    • ScyllaDB Requirements
      • System Requirements
      • OS Support
      • Cloud Instance Recommendations
      • ScyllaDB in a Shared Environment
    • Migrate to ScyllaDB
      • Migration Process from Cassandra to ScyllaDB
      • ScyllaDB and Apache Cassandra Compatibility
      • Migration Tools Overview
    • Integration Solutions
      • Integrate ScyllaDB with Spark
      • Integrate ScyllaDB with KairosDB
      • Integrate ScyllaDB with Presto
      • Integrate ScyllaDB with Elasticsearch
      • Integrate ScyllaDB with Kubernetes
      • Integrate ScyllaDB with the JanusGraph Graph Data System
      • Integrate ScyllaDB with DataDog
      • Integrate ScyllaDB with Kafka
      • Integrate ScyllaDB with IOTA Chronicle
      • Integrate ScyllaDB with Spring
      • Shard-Aware Kafka Connector for ScyllaDB
      • Install ScyllaDB with Ansible
      • Integrate ScyllaDB with Databricks
      • Integrate ScyllaDB with Jaeger Server
      • Integrate ScyllaDB with MindsDB
  • ScyllaDB for Administrators
    • Administration Guide
    • Procedures
      • Cluster Management
      • Backup & Restore
      • Change Configuration
      • Maintenance
      • Best Practices
      • Benchmarking ScyllaDB
      • Migrate from Cassandra to ScyllaDB
      • Disable Housekeeping
    • Security
      • ScyllaDB Security Checklist
      • Enable Authentication
      • Enable and Disable Authentication Without Downtime
      • Creating a Superuser
      • Generate a cqlshrc File
      • Reset Authenticator Password
      • Enable Authorization
      • Grant Authorization CQL Reference
      • Certificate-based Authentication
      • Role Based Access Control (RBAC)
      • ScyllaDB Auditing Guide
      • Encryption: Data in Transit Client to Node
      • Encryption: Data in Transit Node to Node
      • Generating a self-signed Certificate Chain Using openssl
      • Configure SaslauthdAuthenticator
      • Encryption at Rest
      • LDAP Authentication
      • LDAP Authorization (Role Management)
      • Software Bill Of Materials (SBOM)
    • Admin Tools
      • Nodetool Reference
      • CQLSh
      • Admin REST API
      • Tracing
      • ScyllaDB SStable
      • ScyllaDB SStable Script API
      • ScyllaDB Types
      • SSTableLoader
      • cassandra-stress
      • ScyllaDB Logs
      • Seastar Perftune
      • Virtual Tables
      • Reading mutation fragments
      • Maintenance socket
      • Maintenance mode
      • Task manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
    • ScyllaDB Manager
    • Upgrade Procedures
      • Upgrade Guides
    • System Configuration
      • System Configuration Guide
      • scylla.yaml
      • ScyllaDB Snitches
      • Configuration Parameters
    • Benchmarking ScyllaDB
    • ScyllaDB Diagnostic Tools
  • ScyllaDB for Developers
    • Develop with ScyllaDB
    • Tutorials and Example Projects
    • Learn to Use ScyllaDB
    • ScyllaDB Alternator
    • ScyllaDB Drivers
  • CQL Reference
    • CQLSh: the CQL shell
    • Reserved CQL Keywords and Types (Appendices)
    • Compaction
    • Consistency Levels
    • Consistency Level Calculator
    • Data Definition
    • Data Manipulation
      • SELECT
      • INSERT
      • UPDATE
      • DELETE
      • BATCH
    • Data Types
    • Definitions
    • Global Secondary Indexes
    • Expiring Data with Time to Live (TTL)
    • Functions
    • CQL Guardrails
    • Wasm support for user-defined functions
    • JSON Support
    • Materialized Views
    • DESCRIBE SCHEMA
    • Service Levels
    • ScyllaDB CQL Extensions
  • Alternator: DynamoDB API in ScyllaDB
    • Getting Started With ScyllaDB Alternator
    • ScyllaDB Alternator for DynamoDB users
    • Alternator-specific APIs
    • Reducing network costs in Alternator
    • Alternator Vector Search
  • Features
    • Lightweight Transactions
    • Global Secondary Indexes
    • Local Secondary Indexes
    • Materialized Views
    • Counters
    • Change Data Capture
      • CDC Overview
      • The CDC Log Table
      • Basic operations in CDC
      • CDC Streams
      • CDC Stream Changes
      • Querying CDC Streams
      • Advanced column types
      • Preimages and postimages
      • Data Consistency in CDC
    • Workload Attributes
    • Workload Prioritization
    • Backup and Restore
    • Incremental Repair
    • Automatic Repair
    • Vector Search
    • Full-Text Search
  • ScyllaDB Architecture
    • Data Distribution with Tablets
    • ScyllaDB Ring Architecture
    • ScyllaDB Fault Tolerance
    • Consistency Level Console Demo
    • ScyllaDB Anti-Entropy
      • ScyllaDB Hinted Handoff
      • ScyllaDB Read Repair
      • ScyllaDB Repair
    • SSTable
      • ScyllaDB SSTable - 2.x
      • ScyllaDB SSTable - 3.x
    • Compaction Strategies
    • Raft Consensus Algorithm in ScyllaDB
    • Zero-token Nodes
  • Troubleshooting ScyllaDB
    • Errors and Support
      • Report a ScyllaDB problem
      • Error Messages
      • Change Log Level
    • ScyllaDB Startup
      • Ownership Problems
      • ScyllaDB will not Start
    • Cluster and Node
      • Handling Node Failures
      • Failure to Add, Remove, or Replace a Node
      • Failed Decommission Problem
      • Cluster Timeouts
      • Node Joined With No Data
      • NullPointerException
      • Failed Schema Sync
    • Data Modeling
      • ScyllaDB Large Partitions Table
      • ScyllaDB Large Rows and Cells Table
      • Large Partitions Hunting
      • Failure to Update the Schema
    • Data Storage and SSTables
      • Space Utilization Increasing
      • Disk Space is not Reclaimed
      • SSTable Corruption Problem
      • Pointless Compactions
      • Limiting Compaction
    • CQL
      • Time Range Query Fails
      • COPY FROM Fails
      • CQL Connection Table
    • ScyllaDB Monitor and Manager
      • Manager and Monitoring integration
      • Manager lists healthy nodes as down
    • Installation and Removal
      • Removing ScyllaDB on Ubuntu breaks system packages
  • Knowledge Base
    • Upgrading from experimental CDC
    • Compaction
    • Consistency in ScyllaDB
    • Counting all rows in a table is slow
    • CQL Query Does Not Display Entire Result Set
    • When CQLSh query returns partial results with followed by “More”
    • Run ScyllaDB and supporting services as a custom user:group
    • Customizing CPUSET
    • Decoding Stack Traces
    • Snapshots and Disk Utilization
    • DPDK mode
    • Debug your database with Flame Graphs
    • Efficient Tombstone Garbage Collection in ICS
    • How to Change gc_grace_seconds for a Table
    • Gossip in ScyllaDB
    • How does ScyllaDB LWT Differ from Apache Cassandra ?
    • Map CPUs to ScyllaDB Shards
    • ScyllaDB Memory Usage
    • NTP Configuration for ScyllaDB
    • POSIX networking for ScyllaDB
    • ScyllaDB consistency quiz for administrators
    • Recreate RAID devices
    • How to Safely Increase the Replication Factor
    • ScyllaDB and Spark integration
    • Increase ScyllaDB resource limits over systemd
    • ScyllaDB Seed Nodes
    • How to Set up a Swap Space
    • ScyllaDB Snapshots
    • ScyllaDB payload sent duplicated static columns
    • Stopping a local repair
    • System Limits
    • How to flush old tombstones from a table
    • Time to Live (TTL) and Compaction
    • ScyllaDB Nodes are Unresponsive
    • Update a Primary Key
    • Using the perf utility with ScyllaDB
    • Configure ScyllaDB Networking with Multiple NIC/IP Combinations
  • Reference
    • AWS Images
    • Azure Images
    • GCP Images
    • Configuration Parameters
    • Glossary
    • Limits
    • API Reference
      • Authorization Cache
      • Cache Service
      • Collectd
      • Column Family
      • Commit Log
      • Compaction Manager
      • Endpoint Snitch Info
      • Error Injection
      • Failure Detector
      • Gossiper
      • Hinted Handoff
      • LSA
      • Messaging Service
      • Raft
      • Storage Proxy
      • Storage Service
      • Stream Manager
      • System
      • Task Manager Test
      • Task Manager
      • Tasks
    • Metrics
  • ScyllaDB FAQ
  • 2024.2 and earlier documentation
Docs Tutorials University Contact Us About Us
© 2026, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 09 Jul 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2