* fix hnsw full scan threshold
* add test
* are you happy clippy
* separate open_vector_storage
* remove public fields from builder
* wip: do not create segment in builder before build
* avoid arc in storage test and low-level loading functions
* WIP: remove internal segment from SegmentBuilder
* fmt
* finalize segment builder fixes
* Revert "are you happy clippy"
This reverts commit c04afa6989.
* Revert "add test"
This reverts commit 8e7ad6207e.
* Revert "fix hnsw full scan threshold"
This reverts commit 8904443fcb.
* remove _daatabse from builder
* fix optimizer test
* fix id tracker versions persistence
* do flush for segment components on build
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* use correct vector storage size
* remove dim from segment entry
* are you happy fmt
* codespell and proportions
* remove obsolete comment
* remove `try_vector_dim`
* are you happy fmt
* remove todo
* revert code of conduct
* check div 0
* Simplify a bit with max iterator
* Update lib/segment/src/index/hnsw_index/hnsw.rs
Co-authored-by: Tim Visée <tim+github@visee.me>
* are you happy fmt
* Update lib/segment/src/index/plain_payload_index.rs
Co-authored-by: Tim Visée <tim+github@visee.me>
* review fix
* set full scan threshold 0 for test
* use u128 also for multivector storages
* fix sparse vector size calculation
* Move size calculation into if-branch
---------
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
* add `query` to shard trait
* add missing conversions for query
* update grpc docs
* Query response has intermediate results
* add ShardQueryResponse description
* move pub use to the top, keep only one way of reaching reexports
* Allow multivec search on legacy REST API
* show that it works for gRPC as well
* better error message
* update error assertion
* show validation on REST as well
* remove unecessary test
* fix conversion - dim is not vec count
* fmt
* Use TypedMultiDenseVectorRef everywhere (#4224)
* Use TypedMultiDenseVectorRef everywhere
* remove obsolete test
* fix codespell
* fix build
* test single dense vector expansion on upsert
---------
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
* introduce QueryContext, which accumulates runtime info needed for executing search
* fmt
* propagate query context into segment internals
* [WIP] prepare idf stats for search query context
* Split SparseVector and RemmapedSparseVector to guarantee we will not mix them up on the type level
* implement filling of the query context with IDF statistics
* implement re-weighting of the sparse query with idf
* fmt
* update idf param only if explicitly specified (more consistent with diff param update
* replace idf bool with modifier enum, improve further extensibility
* test and fixes
* Update lib/collection/src/operations/types.rs
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
* review fixes
* fmt
---------
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
* byte storage with quantization
raw scorer integration
config and test
are you happy fmt
fn renamings
cow refactor
use quantization branch
quantization update
* are you happy clippy
* don't use distance in quantized scorers
* fix build
* add fn quantization_preprocess
* apply preprocessing for only cosine float metric
* fix sparse vectors tests
* update openapi
* more complicated integration test
* update openapi comment
* mmap byte storages support
* fix async test
* move .unwrap closer to the actual check of the vector presence
* fmt
* remove distance similarity function
* avoid copying data while working with cow
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* move check for unindexed segment size inside the segment to allow proxy shard decide where to search better
* fmt
* move indexed_only check inside the plain index
* Integrate Multivector at segment level
* more tests - green with lower accuracy
* decrease expected accuracy to fix test
* cleanup test
* multivector can not be empty
* vary number of vector per multivec point
* Multivec knob for SegmentConfig
* regen openapi
* add TODO for next step
* introduce multivecconfig to support more similarity aggregation
* update openapi
* colbert query scorers (#3713)
* colbert query scorers
fix build after rebase
* review remarks
multivector hnsw test
* fixes after rebase
* fix test
* fix build after rebase
* review remark
* Support set by key in low level.
* Rename key field.
* Format.
* Pass key.
* Format.
* Test.
* Clippy.
* Fix ci lint.
* Check grpc consistency.
* Update openapi.
* Fix empty key test case.
* Support array index.
* Format.
* Add test for non exists key.
* Clippy fix.
* Add idempotence test.
* Update index by updated payload.
* Add ut for utils.
* Add ut for 1 level key.
* Fix ut.
* Support no exits key.
* Fix test result.
* Fix after rebase
* handle wildcart insertion into non-existing array
* avoid double read of payload during update
* fix missing removing data from index in case if set_payload removes indexed field
---------
Co-authored-by: Shylock Hg <shylock@DESKTOP-40I855A>
Co-authored-by: Albert Safin <xzfcpw@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
* Add min_should field in Filter struct
* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test
* docs, cardinality estimation, grpc not implemented yet
* Add min_should field in Filter struct
* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test
* Impl min_should clause in REST API
* perform cardinality estimation by estimating cardinalities of intersection and combining as union
* add openapi spec with docs update
* add integration test
* Impl min_should clause in gRPC
* Cargo fmt & clippy
* Fix minor comments
* add equivalence test between min_should and must
* shortcut at min_count matches
* use `Filter::new_*` whenever possible
* Add missing min_should field
* Fix gRPC field ordering & remove deny_unknown_fields
* Empty commit
---------
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
* add benches for large MatchAny
* use HashSet for MatchAny
* use fnv hash
* make fnv workspace level dependency; apply clippy
* remove SmolStr from Keyword; Improve performance
* add bench for small number of keywords
* fix openapi
* fix performance issue
* apply integer optimization; create magic number constant
* Move CPU count function to common, fix wrong CPU count in visited list
* Change default number of rayon threads to 8
* Use CPU budget and CPU permits for optimizer tasks to limit utilization
* Respect configured thread limits, use new sane defaults in config
* Fix spelling issues
* Fix test compilation error
* Improve breaking if there is no CPU budget
* Block optimizations until CPU budget, fix potentially getting stuck
Our optimization worker now blocks until CPU budget is available to
perform the task.
Fix potential issue where optimization worker could get stuck. This
would happen if no optimization task is started because there's no
available CPU budget. This ensures the worker is woken up again to
retry.
* Utilize n-1 CPUs with optimization tasks
* Better handle situations where CPU budget is drained
* Dynamically scale rayon CPU count based on CPU size
* Fix incorrect default for max_indexing_threads conversion
* Respect max_indexing_threads for collection
* Make max_indexing_threads optional, use none to set no limit
* Update property documentation and comments
* Property max_optimization_threads is per shard, not per collection
* If we reached shard optimization limit, skip further checks
* Add remaining TODOs
* Fix spelling mistake
* Align gRPC comment blocks
* Fix compilation errors since last rebase
* Make tests aware of CPU budget
* Use new CPU budget calculation function everywhere
* Make CPU budget configurable in settings, move static budget to common
* Do not use static CPU budget, instance it and pass it through
* Update CPU budget description
* Move heuristic into defaults
* Fix spelling issues
* Move cpu_budget property to a better place
* Move some things around
* Minor review improvements
* Use range match statement for CPU count heuristics
* Systems with 1 or 2 CPUs do not keep cores unallocated by default
* Fix compilation errors since last rebase
* Update lib/segment/src/types.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
* Update lib/storage/src/content_manager/toc/transfer.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
* Rename cpu_budget to optimizer_cpu_budget
* Update OpenAPI specification
* Require at least half of the desired CPUs for optimizers
This prevents running optimizations with just one CPU, which could be
very slow.
* Don't use wildcard in CPU heuristic match statements
* Rename cpu_budget setting to optimizer_cpu_budget
* Update CPU budget comments
* Spell acquire correctly
* Change if-else into match
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
* Rename max_rayon_threads to num_rayon_threads, add explanation
* Explain limit in update handler
* Remove numbers for automatic selection of indexing threads
* Inline max_workers variable
* Remove CPU budget from ShardTransferConsensus trait, it is in collection
* small allow(dead_code) => cfg(test)
* Remove now obsolete lazy_static
* Fix incorrect CPU calculation in CPU saturation test
* Make waiting for CPU budget async, don't block current thread
* Prevent deadlock on optimizer signal channel
Do not block the optimization worker task anymore to wait for CPU budget
to be available. That prevents our optimizer signal channel from being
drained, blocking incoming updates because the cannot send another
optimizer signal. Now, prevent blocking this task all together and
retrigger the optimizers separately when CPU budget is available again.
* Fix incorrect CPU calculation in optimization cancel test
* Rename CPU budget wait function to notify
* Detach API changes from CPU saturation internals
This allows us to merge into a patch version of Qdrant. We can
reintroduce the API changes in the upcoming minor release to make all of
it fully functional.
---------
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
* Merge serde attributes
* Remove obsolete conversion
* Add integer type with parameters
* Make integer lookup and range parameters non-optional
* Add parameterized integer index types test
Co-authored-by: Di Zhao <diz@twitter.com>
* Cleanup
---------
Co-authored-by: Di Zhao <diz@twitter.com>
* sparse vectors with large indices support
* fix unit tests
* add tracker file to snapshot
* fix unit tests
* are you happy clippy
* fix config loading
* test with max value
* fix python tests
* fix consensus tests
* review remarks; acc test for inverted index
* remove quantization update from hnsw index
* test that hnsw was builded with presented quantization
* are you happy codespell
* prefer method over public field
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* internal sparse vector segment configs
update openapi
fix build
provide correct index type to fixtures
internal sparse vector segment configs
update openapi
fix build
load ram sparse index from file
fix spelling
add test
spelling error
use appendable flag to decide load or not
fix conflict
dont flush mmap when file is empty
* fix build
* set list of files for snapshot
* fix snapshots test
* fix codespell
* simple save-load unit test
* refactor InvertedIndex::files
* fix unit tests
* add debug_assert
* test all persistence loading cases
* sparse vectors query scorer
plain search test without internals
fix sparse_vector_index_plain_search
fix async scorer build
fix unit tests
are you happy fmt
sparse index with full query support
fix benches, use exact flag to force plain search
add alias and comment to exact flag
fix tests
recommendations TODOs fix
add simple test
add todo
refactor index
test vs comparison dense and sparse discovery
are you happy fmt
propogate error from avg negatives
reuse filtered points list
rollback api changes
better discovery test
are you happy fmt
rollback openapi
fix build
fix tests
review remark recommendations
review remarks
review remarks
codespell
integrate plain search
Update lib/collection/src/recommendations.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Update lib/collection/src/recommendations.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Update lib/collection/src/recommendations.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
fix comment of plain search
Update lib/collection/src/recommendations.rs
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
fix tests
* simplify search query function
* Estimate sparse vector dimension for optimizer (#3142)
* Estimate sparse vector dimension for optimizer
* add hack explanation + todo
Fix optimizer change sparse index on disk
fix index to disk
is appendable fix
add index files if necessary
fix test
* fix tests
---------
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>