All Products
Search
Document Center

Tair (Redis® OSS-Compatible):TairSearch performance whitepaper

Last Updated:Mar 28, 2026

TairSearch is Tair's in-house full-text search data structure. It uses Elasticsearch-compatible query syntax and is built on multi-core parallel computing and inverted indexes optimized for text search. This whitepaper benchmarks TairSearch against RediSearch across write, overwrite, and query workloads so you can evaluate performance differences and reproduce the results in your own environment. All commands, environment configurations, and test data sources are provided so the results can be independently verified.

For TairSearch API documentation, see Search.

Test environment

Client

ItemDescription
HostElastic Compute Service (ECS) instance of the ecs.g7.8xlarge type. For more information, see Overview of instance families.
Region and zoneZone K in the China (Hangzhou) region
Operating systemCentOS 7.9 64-bit

Databases

Both databases run on the same ECS instance and use 6 vCPUs and 4 I/O threads.

Table 1. Self-managed Tair database

ItemDescription
Tair versionRedis 5.0-compatible DRAM-based instance of version 5.0.30
I/O threads4
CPU6 vCPUs. Sample command: taskset -c 1-6 ./src/redis-server redis.conf.

Table 2. Self-managed Redis database

ItemDescription
Redis version7.0.10
RediSearch version2.6.6. The CONCURRENT_WRITE_MODE parameter is set to true.
RedisJSON version2.4.6
I/O threads4
CPU6 vCPUs. Sample command: taskset -c 1-6 ./src/redis-server redis.conf.

Test data

The test dataset contains Wikipedia article abstracts in Chinese and English from Wikimedia. Source files: Index of /zhwiki/latest/ and Index of /enwiki/latest/.

Each document contains four fields: id, title, url, and abstract. Examples:

{
    "id": "History_of_Pakistan",
    "title": "History of Pakistan",
    "url": "https://en.wikipedia.org/wiki/History_of_Pakistan",
    "abstract": "The history of Pakistan for the period preceding the country's independence in 1947..."
}
{
    "id": "Wikipedia:哲学",
    "title": "Wikipedia:哲学",
    "url": "https://zh.wikipedia.org/wiki/%E5%93%B2%E5%AD%A6",
    "abstract": "哲学()是研究普遍的、基本问题的学科,包括存在、知识、价值、理智、心灵、语言等领域。哲学与其他学科不同之处在於哲学有独特之思考方式,例如批判的方式、通常是系统化的方法,并以理性论证为基础。"
}

Test tool

Download the TairSearchBench binary for your operating system:

Run ./TairSearchBench.Linux --help to see all available options.

Usage of ./TairSearchBench.linux:
  -a string
        The address(ip:port) of network to connect
        # The endpoint of the instance.
  -c int
        Benchmark concurrency (default 30)
        # The number of tests that can be run concurrently. Default value: 30.
  -d uint
        Specify the number of seconds for the benchmark (default 30)
        # The duration of the test. When the duration ends, the test is terminated. Default value: 30. Unit: seconds.
  -e string
        The engine backend to run [tairsearch/redisearch]
        # Specify TairSearch or RediSearch as the engine that the instance runs.
  -f string
        Input file to ingest data from (wikipedia abstracts)
        # The path of the execution data file.
  -h string
        Print usage (default "help")
        # Display the usage of the tool.
  -j string
        Specify the big json file to write
        # Specify the path of the JSON file to be written.
  -n uint
        Specify the number of times to benchmark (default 100000)
        # The total number of operations to perform for a test. Default value: 100000.
  -o int
        Overwrite the doc (We will write the document with the same document id)
        # Specify whether to overwrite the original document. Valid values: 1 (true) and 0 (false). Default value: 0.
  -p string
        The password of redis to connect
        # The password of the instance.
  -q string
        Search query string to benchmark
        # The query statement that is used to run tests.
  -s uint
        Specify the compress threshold for tairsearch (default 10000000000)
        # Specify the compression threshold for TairSearch. If the size of a document exceeds the threshold, the document is compressed. Unit: bytes. Default value: 10000000000 (10 KB).
  -t string
        Specify the type of benchmark [write/search/readwrite]
        # Set the test type to write, search, or readwrite.
  -z string
        Specify the analyzer to use for query (default "standard")
        # Specify the analyzer for the query. Default value: standard.

Allocate 20 vCPUs to the client before running tests. Sample command: taskset -c 10-30 ./TairSearchBench.linux.

Preparations

Create a schema (index) before running any test.

  • TairSearch

      {
          "settings": {
              "compress_doc": {
                  "size": "user-defined compression threshold",
                  "enable": true
              }
          },
          "mappings": {
              "properties": {
                  "id":           {"type": "keyword"},
                  "url":          {"type": "keyword", "index": false},
                  "title":        {"type": "text", "analyzer": "user-defined analyzer"},
                  "abstract":     {"type": "text", "analyzer": "user-defined analyzer"},
                  "url_len":      {"type": "integer"},
                  "abstract_len": {"type": "integer"},
                  "title_len":    {"type": "integer"}
              }
          }
      }
  • RediSearch

      SCHEMA
      $.id AS id TEXT
      $.url AS url TEXT NOINDEX
      $.title AS title TEXT
      $.abstract AS abstract TEXT
      $.abstract_len AS abstract_len NUMERIC
      $.url_len AS url_len NUMERIC
      $.title_len AS title_len NUMERIC

    If the test data is documents in Chinese, add LANGUAGE CHINESE to the preceding schema.

Test results

Each write test indexes 1,000,000 documents. Each query test runs 1,000,000 queries against a 1,000,000-document corpus. Each mixed (readwrite) test runs for 60 seconds.

Write data in English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e tairsearch -f ./enwiki-latest-abstract.xml -c 20 -n 1000000 -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e redisearch -f ./enwiki-latest-abstract.xml -c 20 -n 1000000 -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)Memory used (GB)
TairSearch22,615.150.8741.7351.39
RediSearch18,295.101.0922.3521.67

Write data in Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e tairsearch -f ./zhwiki-latest-abstract.xml -c 20 -n 1000000 -a 127.0.0.1:6379 -z jieba
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e redisearch -f ./zhwiki-latest-abstract.xml -c 20 -n 1000000 -a 127.0.0.1:6379 -z chinese

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)Memory used (GB)
TairSearch13,980.411.4273.2751.87
RediSearch10,924.401.8303.8571.83
TairSearch uses more memory than RediSearch in this test because the jieba analyzer produces more fine-grained tokens than the Chinese analyzer used by RediSearch.

Overwrite data in English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e tairsearch -f ./enwiki-latest-abstract.xml -c 20 -n 1000000 -o 1 -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e redisearch -f ./enwiki-latest-abstract.xml -c 20 -n 1000000 -o 1 -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)Memory used (GB)
TairSearch9,775.032.0413.9740.0002
RediSearch22,239.670.8981.380.165
When you perform an overwrite operation, RediSearch marks the original document for later deletion. This causes additional memory usage. In comparison, TairSearch deletes the original document in real time.

Overwrite data in Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e tairsearch -f ./zhwiki-latest-abstract.xml -c 20 -n 1000000 -o 1 -a 127.0.0.1:6379 -z jieba
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t write -e redisearch -f ./zhwiki-latest-abstract.xml -c 20 -n 1000000 -o 1 -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)Memory used (GB)
TairSearch6,194.153.2066.4560.025 (including memory used by the jieba analyzer dictionary)
RediSearch25,096.180.7961.3380.671
When you perform an overwrite operation, RediSearch marks the original document for later deletion. This causes additional memory usage. In comparison, TairSearch deletes the original document in real time.

Term query — English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"term":{"abstract":"hello"}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:hello" -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch45,501.130.4370.563
RediSearch28,513.870.7000.833

Term query — Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"term":{"abstract":"你好"}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:你好" -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch40,670.470.4890.635
RediSearch24,437.480.8171.331

Match query — English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"match":{"abstract":{"operator":"and","query":"chinese history"}}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:chinese history" -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch24,548.940.8120.971
RediSearch2,420.668.2618.523

Match query — Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 100000 -q '{"query":{"match":{"abstract":{"operator":"and","query":"中国的历史"}}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 100000 -q "@abstract:中国的历史" -a 127.0.0.1:6379  -analyzer jieba

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch6,601.053.0273.669
RediSearch889.3722.48622.985

Bool query — English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 100000 -q '{"query":{"bool":{"must":[{"term":{"abstract":"war"}},{"term":{"abstract":"japanese"}},{"range":{"abstract_len":{"gt":500}}}],"must_not":{"term":{"abstract":"America"}},"should":[{"term":{"abstract":"chinese"}},{"term":{"abstract":"china"}}]}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 100000 -q "@abstract:(war japanese -America (chinese|china)) @abstract_len:[500 +inf]"  -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch4,554.224.3885.702
RediSearch1,124.0817.79118.444

Bool query — Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 100000 -q '{"query":{"bool":{"must":[{"term":{"abstract":"战争"}},{"term":{"abstract":"日本"}},{"range":{"abstract_len":{"gt":500}}}],"must_not":{"term":{"abstract":"美国"}},"should":[{"term":{"abstract":"中国"}},{"term":{"abstract":"亚洲"}}]}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:(日本 -美国 (中国|亚洲)) @abstract_len:[500 +inf]"  -a 127.0.0.1:6379 -analyzer jieba

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch2,619.007.62318.42
RediSearch1,199.7616.66917.064

Range query — English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"range":{"abstract_len":{"lte":420, "gte":400}}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract_len:[400,420]" -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch2,840.027.0388.599
RediSearch1,307.0215.30016.817

Prefix query — English

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"prefix":{"abstract":"happiness"}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:happiness*" -a 127.0.0.1:6379

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch36,491.100.5450.688
RediSearch25,558.920.7810.930

Prefix query — Chinese

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e tairsearch -c 20 -n 1000000 -q '{"query":{"prefix":{"abstract":"开心"}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t search -e redisearch -c 20 -n 1000000 -q "@abstract:开心*" -a 127.0.0.1:6379 -z chinese

Results

EngineQPSAverage latency (ms)99th percentile latency (ms)
TairSearch41,308.710.4810.638
RediSearch27,457.860.7271.234

Mixed: write + term query

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t readwrite -e tairsearch -f ./enwiki-latest-abstract.xml -c 20 -d 60 -q '{"query":{"term":{"abstract":"hello"}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t readwrite -e redisearch -f ./enwiki-latest-abstract.xml -c 20 -d 60 -q "@abstract:hello" -a 127.0.0.1:6379

Results

EngineAverage write QPSAverage write latency (ms)Average query QPSAverage query latency (ms)
TairSearch14,699.771.35916,224.031.232
RediSearch11,386.751.75511,386.701.755

Mixed: write + bool query

Commands

  • TairSearch

      taskset -c 10-30 ./TairSearchBench.linux -t readwrite -e tairsearch -f ./enwiki-latest-abstract.xml -c 20 -d 60 -q '{"query":{"bool":{"must":[{"term":{"abstract":"war"}},{"term":{"abstract":"japanese"}},{"range":{"abstract_len":{"gt":500}}}],"must_not":{"term":{"abstract":"America"}},"should":[{"term":{"abstract":"chinese"}},{"term":{"abstract":"china"}}]}}}' -a 127.0.0.1:6379
  • RediSearch

      taskset -c 10-30 ./TairSearchBench.linux -t readwrite -e redisearch -f ./enwiki-latest-abstract.xml -c 20 -d 60 -q "@abstract:(war japanese -America (chinese|china)) @abstract_len:[500 +inf]" -a 127.0.0.1:6379

Results

EngineAverage write QPSAverage write latency (ms)Average query QPSAverage query latency (ms)
TairSearch9,589.182.08510,504.311.903
RediSearch5,284.013.7845,283.963.784

Summary

TairSearch delivers higher throughput and lower latency than RediSearch across most query types because of two core design choices:

  • Multi-core parallel computing: TairSearch distributes index intersection and query evaluation across multiple CPU cores, which is particularly effective for complex queries like match, bool, and range that need to intersect multiple posting lists.

  • Inverted indexes optimized for text search: The index structure is purpose-built for full-text workloads, enabling fast single-term lookups and efficient multi-term AND operations.

TairSearch also uses a dedicated data structure for document compression, reducing memory usage without degrading read or write throughput.