Commit Graph

6 Commits

Author SHA1 Message Date
lichen2015 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
Zhuanglin Zheng 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
lichen2015 f539580138
feat: migrate multi-vector query and reranker logic to C++ (#405)
* feat: migrate multi-vector query and reranker logic to C++

- Add Reranker base class with RrfReRanker and WeightedReRanker implementations
- Add Collection::MultiQuery interface for multi-vector queries with reranking
- Add MultiVectorQuery struct in doc.h with forward declaration for Reranker
- Add C API bindings for reranker and MultiQuery (zvec_reranker_*, zvec_multi_vector_query_*, zvec_collection_multi_query)
- Add Python binding for reranker classes with py::function bridge for callback
- Validate duplicate field names in multi-vector queries (C++ and Python consistent)
- Remove TODO comment about concurrent execution (SQLEngine is not thread-safe)
- Update collection.h MultiQuery doc comment from concurrently to sequentially
- Add C++ collection tests (6 MultiQuery test cases)
- Add C API tests (reranker functions + multi_vector_query end-to-end)
- Implement Python test cases (11 previously skipped tests now active)
- Simplify Python query_executor validation for unified duplicate field check

* style: format Python files with ruff

* fix: adapt to main branch API changes (VectorQuery->Query rename, validate_and_sanitize)

* fix: multi_vector tests now use multiple same-type vector fields (dense2, sparse2)

* fix: suppress RET501 for intentional default return None in RerankFunction._get_object

* style: ruff format test_collection.py

* refact multi vector query

* format code

* fix(multi-vector): expose SubVectorQuery in Python binding, fix tests

- Register _SubVectorQuery in pybind11 with from_vector_query() factory
- Convert _VectorQuery to _SubVectorQuery in MultiVectorQueryExecutor
- Relax RRF/Weighted score assertion tolerance from 1e-10 to 1e-6
- Fix WeightedReRanker test metric to IP (matching HnswIndexParam default)

* style: ruff format query_executor.py

* fix: define _USE_MATH_DEFINES for M_PI on Windows (MSVC)

* refactor: include reranker.h directly in query.h instead of forward declaration

* refactor(reranker): move topn from member variable to rerank() parameter

* refact code

* style(python): fix ruff UP035/UP037 in multi_vector_reranker

- import Callable from collections.abc instead of typing (UP035)
- remove redundant quotes around MetricType annotations (UP037)

* chore: trigger PR sync

* refact code

* fix(examples): restore CMakeLists.txt formatting broken by clang-format

* refactor(reranker): remove redundant metrics_ map by querying schema directly, and use insert return value to avoid duplicate set lookup

* refactor(reranker): defer schema binding to query time and remove C API callback reranker
2026-05-29 10:10:41 +08:00
feihongxu0824 bbe4ca7bae
minor: fix c example cmake and build c++ dynamic lib (#347) 2026-04-20 22:08:34 +08:00
lichen2015 6ac9bb0177
fix: refact c struct name (#302) 2026-04-02 14:54:03 +08:00
lichen2015 ed8c010cfd
feat: add c language support (#167)
* init branch

Add GitHub Actions release workflow for C API

add release linux-arm64

remove c api version

refact some code

add api reference

* feat(c-api): add nullable/doc-result APIs for agency migration (#234)


* Flattened index parameters structure

* refact c api code

* remove RAII guard

* refact use opaque pointer pattern

* refact version info

* refact use pure opaque pointers

* use typedef instead of enum

* fix set_last_error

* fix build yml

* fix doc.h

* remove wheel exclude

* fix c msvc link

* remove release yml

* fix c link libstdc++

* fix c link libgcc

---------

Co-authored-by: Donny/강동윤 <kdy.1997.dev@gmail.com>
2026-03-31 18:00:08 +08:00