feat: add VECTOR_FP64 (double-precision) vector support#33
Merged
Conversation
Add FP64 vector type support for schema, documents, and queries: - FFI layer: add schema/docer/getter/query functions for double-precision vectors - Fix has_vector/vector_names/field_names to handle std::vector<double> - Schema: ZVecSchema::addVectorFp64() - Doc: setVectorFp64() / getVectorFp64() - Query: queryFp64(), ZVecVectorQuery::setFp64() flag, queryById() FP64 support - Test: test_fp64_vectors.phpt covering insert, fetch, query, index types Closes #31
- ZVecSchema: addVectorFp64() method - ZVecDoc: setVectorFp64() / getVectorFp64() methods - ZVec: queryFp64() method - ZVecVectorQuery: useFp64 property + setFp64() method - ZVec::query(): route to FP64 path when ZVecVectorQuery.useFp64 is true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add FP64 (double-precision) vector support for schema, documents, and queries.
Changes
FFI C++ Layer (
ffi/zvec_ffi.h,ffi/zvec_ffi.cc)zvec_schema_add_field_vector_fp64()— add FP64 vector field to schemazvec_doc_set_vector_fp64()/zvec_doc_get_vector_fp64()— FP64 doc getter/setterzvec_collection_query_fp64()/zvec_collection_query_fp64_ex()— FP64 vector searchzvec_doc_has_vector()— now also detectsstd::vector<double>fieldszvec_doc_vector_names()/zvec_doc_field_names()— include/exclude FP64 fieldsPHP Layer (
src/ZVec.php)ZVec::TYPE_VECTOR_FP64 = 24ZVecSchema::addVectorFp64()— schema builder methodZVecDoc::setVectorFp64()/getVectorFp64()— doc vector accessorsZVec::queryFp64()— explicit FP64 vector query with optional extended paramsZVecVectorQuery::setFp64()flag — route query through FP64 pathZVec::queryById()— auto-detects FP64 fields and routes correctlyTests
tests/test_fp64_vectors.phpt— insert, fetch, query, filter, outputFields, HNSW, Flat, vectorNames/hasVector, ZVecVectorQuery, queryByIdCloses #31