Skip to content

feat(full-text): support full-text search modes for unindexed row ranges - #559

Open
SteNicholas wants to merge 2 commits into
apache:mainfrom
SteNicholas:PAIMON-406
Open

SteNicholas wants to merge 2 commits into
apache:mainfrom
SteNicholas:PAIMON-406

Conversation

@SteNicholas

@SteNicholas SteNicholas commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Purpose

Closes #406.

Full-text searches can now find matching rows appended after the last index build. fast searches stored shards only. When the selected partitions contain a full-text index for the column, full finds gaps below the snapshot’s next row ID and detail finds gaps in the selected data files. As in Java Paimon, only single-field indexes count toward coverage.

The planner assigns disjoint ranges to stored and raw splits. Workers read the snapshot and schema recorded by the planner. For an explicit snapshot, tag, or timestamp, the planner resolves text and filter columns in the selected snapshot’s schema. A temporary Tantivy or Lucene++ index scores all live, non-null text in the raw ranges. Row filters apply before ranking, and the final top-k combines hits from the temporary index and the stored shards. In full and detail scalar modes, the reader evaluates the filter against data files where scalar indexes lack coverage or cannot evaluate the predicate.

Tests

  • Unit tests cover mode precedence, coverage gaps, split encoding versions, invalid snapshot IDs, and the lifetime of outstanding shard tasks when submission fails.
  • Tantivy and Lucene++ integration tests cover appended rows, partially indexed partitions, deletion vectors, scalar filters before top-k, and historical searches after schema changes.
  • The distributed search test compares ExecuteLocal() with independent workers that each deserialize one split. It checks both the primary and extra text columns, for top-1 and for all matches.

API and Format

RawFullTextSearchSplit exposes the planning snapshot ID, column name, and row ranges. Raw split V1 carries the text field ID and planning schema ID. Stored split V3 adds the planning schema ID, and readers also accept stored V1 and V2. These encodings carry work between C++ workers. Both backends build the temporary index in memory.

full-text-index.search-mode and scalar-index.search-mode each override global-index.search-mode and default to fast. vector-index.search-mode is reserved for table-level vector search.

Documentation

The guide explains how to choose a search mode, how raw text contributes to scores, and how to pin a subsequent data read to the search snapshot, including when a tag retains an expired snapshot. Global index guide

Generative AI tooling

Generated-by: Codex (GPT-6)

@SteNicholas
SteNicholas force-pushed the PAIMON-406 branch 3 times, most recently from 9f55edc to af6138c Compare November 14, 2026 12:10
@lxy-9602
lxy-9602 requested a review from zjw1111 November 16, 2026 01:54

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding support for unindexed rows.

Could you add entries to LICENSE for the upstream source included in cmake_modules/full_text.diff and cmake_modules/lucene.diff, following the existing Arrow and ORC patch entries? Please list Apache Paimon Full Text 0.1.0 and Lucene++ 3.0.9 under Apache-2.0, and retain the Lucene++ headers' copyright attribution to Alan Wright (2009–2014).

Comment thread cmake_modules/lucene.diff Resolved
Comment thread cmake_modules/ThirdpartyToolchain.cmake Resolved
Use the snapshot's next row ID in full mode and the selected data
files' row ranges in detail mode to find gaps in single-field full-text
coverage. Plan raw splits only when a selected partition has a
full-text index for the column. Keep fast mode index-only.

Assign disjoint row ranges to stored and raw splits and pin both to the
planning snapshot and schema. Index live, non-null raw text in memory
with Tantivy or Lucene++. Apply row filters before ranking and merge
stored and raw hits for the final top-k.

When scalar search mode is full or detail, evaluate the row filter
against data files for uncovered ranges, or for all searched rows if
no scalar index can evaluate the predicate.

Refs: apache#406
@SteNicholas

SteNicholas commented Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

@zjw1111, I added entries to LICENSE for both upstream patches. Apache Paimon Full Text 0.1.0 and Lucene++ 3.0.9 are listed under Apache-2.0, and the Lucene++ entry preserves Alan Wright’s 2009–2014 copyright. License entries · Original review

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support full-text search modes for unindexed row ranges

2 participants