zvec/tests/db/sqlengine
egolearner 443500dc45
feat: add FTS support for Collection::CreateIndex/DropIndex (#445)
* feat: add FTS support for Collection::CreateIndex/DropIndex

Enable dynamic creation and removal of FTS indexes on existing STRING
columns through the standard CreateIndex/DropIndex API, matching the
lifecycle model already used by vector and scalar (invert) indexes.

Key changes:
- New FtsIndexer class (fts_indexer.h/cc) encapsulating per-segment FTS
  RocksDB management: multi-field lifecycle, snapshot, insert, seal
- New BlockType::FTS_INDEX with block_id-based directory naming
  (fts.<block_id>.rocksdb) for crash-safe snapshot-and-swap
- Segment::create_fts_index builds FTS index on a snapshot copy by
  scanning forward store, then outputs new SegmentMeta + FtsIndexer
  for atomic reload (same pattern as create_scalar_index)
- Segment::drop_fts_index snapshots, removes field CFs, outputs updated
  meta (or nullptr when last FTS field is removed)
- Collection layer wires FTS into the existing task dispatch, version
  update, and reload loops alongside vector/invert paths
- CreateIndex/DropIndex reject unsupported index types explicitly
  instead of falling through to the wrong branch

* fixup! feat: add FTS support for Collection::CreateIndex/DropIndex

    fix: address review comments for FTS CreateIndex/DropIndex

    - Reject CreateIndex when column already has a different index type
      (e.g. FTS on an INVERT-indexed column) at both Collection and
      Segment layers
    - Allow same-type different-params CreateIndex to rebuild the index
      (remove old + create new + replay data), aligned with INVERT behavior
    - Return OK when CreateIndex is called with identical params
    - Rename operator[] to get() in both FtsIndexer and InvertedIndexer
    - Add test cases: create→drop→create→drop cycle, and params-change
      rebuild with case-sensitivity verification

* android skip Feature_CreateOrDropFtsIndex

* fixup! feat: add FTS support for Collection::CreateIndex/DropIndex
2026-06-03 17:56:56 +08:00
..
CMakeLists.txt feat: add fts support (#408) 2026-06-01 15:02:54 +08:00
contain_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00
forward_recall_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00
fts_multi_segment_test.cc feat: add fts support (#408) 2026-06-01 15:02:54 +08:00
fts_parser_test.cc feat: add fts support (#408) 2026-06-01 15:02:54 +08:00
fts_recall_test.cc feat: add fts support (#408) 2026-06-01 15:02:54 +08:00
invert_recall_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00
like_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00
mock_segment.h feat: add FTS support for Collection::CreateIndex/DropIndex (#445) 2026-06-03 17:56:56 +08:00
optimizer_test.cc refactor: tidy query APIs and execution (#431) 2026-06-01 21:07:35 +08:00
query_info_test.cc refactor: tidy query APIs and execution (#431) 2026-06-01 21:07:35 +08:00
recall_base.h feat(ci): integrate clang-tidy for changed C/C++ files (#116) 2026-04-20 20:14:21 +08:00
simple_rewriter_test.cc refactor: tidy query APIs and execution (#431) 2026-06-01 21:07:35 +08:00
sqlengine_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00
test_helper.h feat(ci): integrate clang-tidy for changed C/C++ files (#116) 2026-04-20 20:14:21 +08:00
vector_recall_test.cc refactor: drop VectorQuery, unify single-target query on SearchQuery (#428) 2026-05-29 16:36:09 +08:00