Commit Graph
128 Commits
Author SHA1 Message Date
egolearner 6eed986ac5 fix: properly handle larger final IPC chunk in mmap store (#645) 2026-08-04 16:58:10 +08:00
egolearner 58375ff7b8 feat(fts): add ngram tokenizer (#593) 2026-08-03 14:06:15 +08:00
ZeFeng Yin be6d7b7cfb test: stabilize DiskANN and IVF searcher tests (#637) 2026-08-03 10:39:17 +08:00
luoxiaojian ad36b75966 fix(vamana): honor asymmetric query metrics (#635) 2026-07-30 20:11:37 +08:00
luoxiaojian 1ad6df2539 refactor(thread-pool): make CPU affinity opt-in (#623) 2026-07-29 15:30:04 +08:00
egolearner 31be25598a fix(db): persist delete-only writing segment records (#618) 2026-07-28 20:36:02 +08:00
feihongxu0824 e2ea49d4ac fix: limit Windows all-in-one DLL exports (#611) 2026-07-28 11:51:44 +08:00
ZeFeng Yin 8f276e07b1 fix(diskann): make Linux AIO fallback safe for partial operations (#615) 2026-07-27 16:57:52 +08:00
Zhuanglin Zhengandray a4347e31f1 Add a preprocessor in Turbo (#548)
Co-authored-by: ray <rui.xing@alibaba-inc.com>
2026-07-24 14:01:52 +08:00
ZeFeng Yin fea2481342 fix: HnswExternalStreamerEntity (#607) 2026-07-20 17:29:23 +08:00
feihongxu0824 e89be98bb3 fix: optimize after crash recovery without opening wal (#600) 2026-07-17 16:56:21 +08:00
mrcs64andmrcs64 a5dfec6a65 fix(segment): propagate forward-store writer open failure instead of crashing (#579)
Co-authored-by: mrcs64 <9069178+mrcs64@users.noreply.github.com>
2026-07-17 16:13:50 +08:00
rayxandZefeng Yin ec8a78ee08 refactor(diskann): decouple from libaio via dlopen (#532)
Co-authored-by: Zefeng Yin <yinzefeng.yzf@alibaba-inc.com>
2026-07-16 17:58:25 +08:00
egolearner 23538ab876 fix(collection): preserve writing segment on DDL failure (#574) 2026-07-16 10:54:56 +08:00
rayx 8693cf9de7 refactor: turbo quantizer (#546) 2026-07-15 19:54:07 +08:00
Jalin Wangandjiliang.ljl 1afdea8dc5 feat(python): expose group-by search to Python API (#561)
Co-authored-by: jiliang.ljl <jiliang.ljl@alibaba-inc.com>
2026-07-13 20:22:07 +08:00
egolearner 4de76fdbde fix(fts): allow global doc id gaps during compaction (#588) 2026-07-13 10:54:30 +08:00
lichen2015andClaude 78ef197aaa feat(c_api): add DiskANN index type support to C API (#495)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-10 16:11:09 +08:00
egolearner a90ec5b1d6 fix(fts): preserve zero-match filter semantics (#584) 2026-07-10 15:20:51 +08:00
egolearner 20f9be250c perf(fts): add block-max skip and score early-exit to ConjunctionIterator (#441) 2026-07-10 11:40:47 +08:00
egolearner 821a9333fc fix(index): snapshot read-only indexes without flush (#569) 2026-07-10 10:55:50 +08:00
egolearner 7449d7193b fix(fts): restore writing segment stats on reopen (#566) 2026-07-10 10:52:46 +08:00
egolearner df6af2f05d feat: Implement standard tokenizer based on UAX29 (#547) 2026-07-09 10:01:56 +08:00
Loyal-YoungandLoyal-Young 6e3f8c3f91 chore: enable targeted bugprone clang-tidy checks (#500)
Co-authored-by: Loyal-Young <266632325+Loyal-Young@users.noreply.github.com>
2026-07-08 10:14:42 +08:00
Jalin Wang 468c565f86 feat(core, indexer): support group_by searching and fix hnsw sparse (#527) 2026-07-07 17:15:12 +08:00
egolearner c35d24e215 feat(fts): add stemmer token filter based on Snowball 3.1.1 (#513) 2026-07-07 14:14:13 +08:00
egolearner 54340bb705 fix: IVF nprobe selected list scanning (#544) 2026-07-03 17:17:37 +08:00
egolearner 59e04ae4cc refactor: remove QueryParams::set_type() (#518) 2026-07-02 17:05:26 +08:00
egolearner b9ce030593 feat(fts): add UTF-8 support for tokenizer and token filters via utf8proc (#515) 2026-07-02 11:31:44 +08:00
lichen2015 a03ea929ed fix(collection): open LOCK file read-only when collection is read-only (#541) 2026-07-01 14:39:33 +08:00
c54f5e16e9 rotate: add an optional random rotation feature in INT8/INT4 quantization method (#483)
Co-authored-by: rayx <rui.xing@alibaba-inc.com>
Co-authored-by: Jalin Wang <wangjianning.wjn@alibaba-inc.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-06-26 19:16:19 +08:00
Jalin Wang cdef8686c7 fix(diskann, hnsw sparse builder): lost-wakeup race in builder progress loops (#530) 2026-06-26 16:35:24 +08:00
Jalin WangandCopilot Autofix powered by AI c72bcd1ce9 minor: typos in ivf searcher test(#526)
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-06-25 19:25:10 +08:00
ZeFeng Yin cb0d3dbdb3 fix: some bugs in ivf index (#524) 2026-06-24 21:39:27 +08:00
egolearner 22744f2c81 feat(c_api): add FTS support for sub-query (#520)
Add zvec_sub_query_set_fts and zvec_sub_query_set_fts_params to allow
setting FTS clause and FTS query parameters on sub-queries, mirroring
the existing zvec_vector_query_set_fts interface.

- zvec_sub_query_set_fts: set/clear FTS clause (copies payload)
- zvec_sub_query_set_fts_params: set FTS query params (takes ownership)
- Add unit test test_fts_wiring_on_sub_query
2026-06-24 10:12:39 +08:00
feihongxu0824 0ac294a9fd fix: clean up RocksDB files on drop_index so create_index can be repeated (#485) 2026-06-22 16:13:59 +08:00
Jalin Wang a055c7e0a2 test(index): add tests for index param builders and fix builder setters (#504) 2026-06-22 14:12:18 +08:00
egolearner aad5718112 feat(query): add VectorViewClause zero-copy path and unify validate (#478)
* feat(query): add VectorViewClause zero-copy path and unify validate

- Add VectorViewClause (string_view-based) as zero-copy counterpart to
  VectorClause; variant now holds VectorClause | VectorViewClause | FtsClause
- Add QueryTarget::get_vector_view() unified accessor via std::visit,
  returns optional<VectorViewClause> regardless of which variant is held
- Split validate_and_sanitize into QueryTarget::validate (read-only) +
  sanitize_sparse_vector (mutate); validate handles both VectorClause and
  VectorViewClause via get_vector_view()
- Collection::Query passes original request directly to sqlengine when no
  sparse sanitization is needed; only copies when sort is required
- Change build_query_info/BuildSQLInfoFromSearchQuery to take const
  SearchQuery& so VectorMatrixNode string_views point to caller's data
2026-06-22 11:32:26 +08:00
Jalin Wang 85cd08d383 feat(storage): expose copy-on-write mmap flag and fix MMAP_POPULATE flag placement
This PR exposes a copy-on-write mmap option through the public StorageOptions API and fixes a bug where the MAP_POPULATE flag was applied to the wrong mmap() argument.
2026-06-17 14:18:12 +08:00
ZeFeng Yin e12bad5e37 feat: external vector source support (#490) 2026-06-17 14:15:52 +08:00
Jalin Wang b1af0e4ebf feat(index): expose is_dirty status through core Index interface (#488)
Adds is_dirty() at each layer: IndexMapping → IndexStorage (virtual) → MMapFileStorage / BufferStorage → Index::IsDirty().
2026-06-17 11:20:40 +08:00
feihongxu0824 841b1ed3f9 fix: refactor parquet buffer cache ownership (#492) 2026-06-16 10:47:07 +08:00
luoxiaojian 7a5f84e648 feat: pass prefetch config (PO and PL) as search params (#482) 2026-06-12 16:33:41 +08:00
feihongxu0824 4679a8f39d feat: support zvec core-only build (#481) 2026-06-09 23:45:42 +08:00
luoxiaojian da39a33feb feat(quantizer): introduce UniformInt8 quantizer with global scale/bias (#474) 2026-06-09 20:10:53 +08:00
Cuiys 0923f7c691 refactor: make Reranker stateless with std::variant value semantics (… (#471)
* refactor: make Reranker stateless with std::variant value semantics (#461)

Replace class hierarchy (Reranker/ScoreBasedReranker/RrfReranker/
WeightedReranker/CallbackReranker) with std::variant<RrfParams,
WeightedParams, CallbackParams> value type and a stateless free function
reranker::rerank().

Key changes:
- reranker.h: define RerankParams variant + reranker::rerank() API
- query.h: MultiQuery::reranker (shared_ptr) -> MultiQuery::rerank (value)
- schema.h: add CollectionSchema::get_field_ptr() returning FieldSchema::Ptr
- collection.cc: push field lookup to caller, pass vector<FieldSchema::Ptr>
- c_api: remove opaque zvec_reranker_t, add zvec_multi_query_set_rerank_*
- python binding: expose _RrfParams/_WeightedParams/_CallbackParams + setters
- python layer: WeightedReRanker(list[float]), remove Python rerank logic
- all tests updated to new interface

Benefits:
- Thread-safe by design: no mutable state, safe to share across threads
- Collection-decoupled: no bind_schema(), field info passed as parameter
- Simpler lifecycle: value semantics, no shared_ptr management

Closes #461

* chore: remove nightly_build.yml unrelated to reranker refactor

* chore: remove uv.lock unrelated to reranker refactor

* fix: raise ValueError when multi-query has no reranker

After the reranker stateless refactor the C++ MultiQuery rerank
strategy uses a std::variant with a default value, so the implicit
'reranker required' validation no longer triggered. Restore the
check in QueryExecutor._execute_multi_query so that a hybrid
(multi-query) request without a reranker raises ValueError.

* fix(reranker): use index_type FTS check for non-vector normalization

Replace dynamic_cast nullptr check with explicit IndexType::FTS check
and map FTS/BM25 positive scores to (0.0, 1.0) via 2*atan(score)/pi.

* refactor(reranker): move Params types into reranker namespace and qualify usages

Move RrfParams, WeightedParams, CallbackParams and RerankParams into the
zvec::reranker namespace, and add explicit reranker:: qualification at all
usage sites outside the reranker module (query.h, python/c bindings, tests).

* refactor(query): drop unused PendingQuery wrapper, use std::vector<SearchQuery> directly

* refactor(reranker): make _to_cpp_params non-abstract with default NotImplementedError

Remove @abstractmethod from RerankFunction._to_cpp_params and provide a
default implementation raising NotImplementedError. Drop the redundant
_to_cpp_params overrides from Qwen and Sentence rerankers since they use
the Python rerank path and don't need the C++ conversion.
2026-06-09 12:44:17 +08:00
Qinren Zhou e8b888f26b minor: fix python doc string for ivf index params (#473) 2026-06-09 11:41:03 +08:00
feihongxu0824 faadf62bd5 fix: use project root for diskann cmake paths (#464) 2026-06-08 09:54:16 +08:00
rayx e720c1fd20 feat: add diskann index (#369) 2026-06-04 20:52:43 +08:00
Cuiys c46efe1241 refactor: change rerank interface from map-based to vector-based (#458)
* refactor: change rerank interface from map-based to vector-based (#452)

- Define QueryResult = list[Doc] type alias in doc.py
- Change C++ Reranker::rerank() signature from map<string, DocPtrList> to vector<DocPtrList>
- Extend bind_schema() to accept field_names for index-based field lookup
- Update ScoreBasedReranker/WeightedReranker/CallbackReranker implementations
- Adapt collection.cc MultiQuery path to use vector<DocPtrList>
- Update Python binding to expose rerank() and use vector<double> weights
- Refactor Python RerankFunction interface to list[QueryResult] -> QueryResult
- Remove Python-layer rerank logic from RrfReRanker/WeightedReRanker (delegate to C++)
- Update query_executor to return list[list[Doc]] instead of dict
- Update all related unit tests (C++ and Python)

* refactor: replace list[Doc] with QueryResult type alias in executor and rerank functions

* refactor: replace list[list[Doc]] with list[QueryResult] in query_executor

* fix: remove unused Doc import in rerank_function.py (ruff F401)

* refactor(query_executor): merge duplicate rerank return paths

* refactor: RrfReRanker/WeightedReRanker.rerank() directly call C++ reranker

* refactor: simplify QueryExecutor into unified class, remove Factory/subclasses/validation/concurrency

* refactor: rename _VectorQuery to _SearchQuery, from_vector_query to from_search_query

* refactor(query_executor): split execute into single/multi paths, rename core_vector to search_query, drop unused core_vectors

* style: apply ruff formatter to test_reranker.py and query_executor.py

* refactor: make rescore() private in ScoreBasedReranker hierarchy

* style: apply clang-format to reranker.h

* style: apply clang-format to all modified C++ files

* refactor: rename private methods in QueryExecutor for clearer semantics

* refactor: rename mvq to multi_query for clarity

* fix: make BasicRRF test order-independent for equal scores

* fix: update collection_test to use vector-based reranker interface

* fix: update reranker tests to expect TypeError instead of NotImplementedError

* refactor: remove PendingQuery wrapper, use SearchQuery directly in MultiQuery path

* refactor: simplify MultiQuery path - remove seen_fields, merge field_names into main loop

* fix: address review comments - defensive checks and remove fields param from C API

- ScoreBasedReranker::rerank(): early return empty list when topn <= 0
- WeightedReranker::rescore(): null-check schema_ before use
- CallbackReranker::rerank(): check callback_ is not empty before invoke
- C API zvec_reranker_create_weighted(): remove unused fields parameter

* fix: remove duplicate field name test (check was intentionally removed)

* fix: address egolearner review comments

- Rename QueryResult to DocList for clarity (见名知义)
- Change docstring to #: comment for type alias
- Fix output_fields check: use 'is not None' instead of truthy check
  (None means unset, [] means explicit empty list - different semantics)
- Raise ValueError when search-by-id finds no document

* refactor: remove redundant output_fields assignment in _build_search_query

* refactor: address egolearner review comments (C++ refactoring)

- c_api.cc: simplify weighted reranker creation with inline vector ctor
- python_reranker.cc: refactor unwrap_rerank_result - take by value,
  early error return, move semantics
- Rename C API functions for consistent naming:
  zvec_reranker_create_rrf -> zvec_create_rrf_reranker
  zvec_reranker_create_weighted -> zvec_create_weighted_reranker
  zvec_reranker_destroy -> zvec_destroy_reranker
  zvec_reranker_get_rank_constant -> zvec_get_reranker_rank_constant
- reranker.h/cc: bind_schema returns Result<void>, caches
  vector<const FieldSchema*> to avoid repeated schema lookups in rescore
- python_param.cc: rename py::arg vector_query to search_query

* revert: rollback bind_schema refactoring due to thread-safety concern

The field_schemas_ caching approach introduces a data race when the same
WeightedReranker instance is shared across concurrent queries: bind_schema()
writes field_schemas_ while rerank() reads it concurrently.

Revert to storing schema_ + field_names_ and looking up fields in rescore().
Add @note thread-safety warning to WeightedReranker class documentation.

* fix: unify error message format in collection.cc

Change 'Vector field not found: X' to 'Invalid query: field X not found'
for consistent error formatting as suggested by zhourrr.

* fix: sort __all__ and remove duplicates in __init__.pyi

Fix RUF022 lint error: sort __all__ alphabetically and remove duplicate
entries (DenseEmbeddingFunction, ReRanker).

* style: format query_executor.py with ruff formatter

* fix: resolve Python test failures after FTS rebase integration

- test_query_executor.py: update method names to match refactored API
  (_do_build -> _build_queries, _do_merge_rerank_results -> _merge_and_rerank)
- test_reranker.py: fix expected exception type (TypeError from pybind11)
- test_collection_fts.py: update error message match patterns
- test_collection_fts_vector_hybrid.py: remove obsolete 'metrics' param,
  update weights from dict to positional list, adapt validation tests
  for multi-vector queries (now supported with reranker)
- test_collection_dql.py: remove 'metrics' param, update weights format
- collection.cc: distinguish FTS vs vector fields in MultiQuery path
  using get_fts_clause() to route field lookup correctly
- reranker.cc: use get_field() instead of get_vector_field() in rescore
  to support FTS+vector hybrid weighted reranking

* refactor: pass topn as rerank() parameter, move rerank_field to model rerankers

* fix: address review comments - rename test functions and restore duplicate field check

* refactor: simplify MultiQuery field lookup, let validate_and_sanitize handle type check
2026-06-04 16:03:28 +08:00