Commit Graph

1367 Commits

Author SHA1 Message Date
Arnaud Gourlay
86ced6d89a Fix payload indexes drop/flush sequence (#7626)
* Fix release mmap handles before removing files

* weak references to handle after drop

* protect from concurrent drop/flush

* simplify locking

* Revert "simplify locking"

This reverts commit 7ebd324be4.
2025-12-02 10:27:48 +01:00
Tim Visée
4010e7219f Add runtime flag to disable opening multiple mmaps on the same file (#7614)
* Fix delete_page not dropping sequential mmap

* In Gridstore Page, support using a single mmap

* In Gridstore Page, only open multiple mmaps if supported at runtime

* Support opening single mmap in UniversalMmapChunk

* Rename environment var, log warning when QDRANT_NO_MULTI_MMAP is set

* Support opening single mmap in MmapDenseVectors

* Remove unused result response

* Import LazyLock
2025-12-01 18:34:05 +01:00
Ivan Pleshkov
8df3dda006 Scalar quantization encoding parameter (#7602)
* scalar quantization encoding parameter

fix ci

remove method

review remarks

fix ci

* uint8 - int8
2025-12-01 12:03:36 +01:00
Arnaud Gourlay
9b5cca03ae Standardize delete payload index terminology (#7630) 2025-11-27 16:01:00 +01:00
Luis Cossío
6ca3e46638 Fix wiping of Gridstore (#7627)
* fix wiping of gridstore

* clippy

* address @timvisee's review
2025-11-27 11:38:19 -03:00
Arnaud Gourlay
3babcfb1df Fix BufferedDynamicFlags flushing with concurrent drop/deletion (#7621)
* Fix BufferedDynamicFlags flushing with concurrent drop/deletion

* make sure to drop before fs remove
2025-11-27 14:18:56 +01:00
Ivan Boldyrev
2a7fc718fa Fix search in empty HNSW segments (#7620)
* Add top==0 tests

* Fix HNSW scan top==0 error
2025-11-27 18:56:10 +07:00
Roman Titov
5ba7ac8ee8 Qdrant Edge Python bindings improvements (#7561)
* Use anonymous lifetime in `FromPyObject` implementations

* Use `PyResult` in `IntoPyObject` implementations

* Cleanup imports and derives

* Cleanup `filter` conversions

* Add `PointVectors` getters

* Move `config` module into sub-directory

* Split `config` into sub-modules

* Simplify enum bindings

* Add zero-cost conversions for `PyVectorDataConfig` and `PySparseVectorDataConfig`

* Add getters to config structures

* fixup! Add getters to config structures

More zero-cost conversions for `PyVector*DataConfig`

* Implement `PyHnswIndexConfig`

* Implement `PyQuantizationConfig`

* fixup! Simplify enum bindings

* fixup! Implement `PyHnswIndexConfig`

* fixup! Implement `PyHnswIndexConfig`

* fixup! Implement `PyHnswIndexConfig`

* Implement `PySparseVectorDataConfig`

* fixup! Implement `PySparseVectorDataConfig`

* fixup! Implement `PySparseVectorDataConfig`
2025-11-26 18:47:17 +01:00
Ivan Boldyrev
b5825c1245 Use batch searcher for sparse vector search (#7572)
It allows to remove `peek_*` methods from `FilteredScorer`, simplifying
code.
2025-11-21 20:29:24 +07:00
Andrey Vasnetsov
43f0c73bf2 fix default rescoring param choice for quantization rescoring (#7570) 2025-11-20 12:21:28 +01:00
Ivan Boldyrev
428f1e76d4 Batched scans for dense vectors (#7514)
* Batched iteration for plain `HNSWIndex` searches
* Batched iteration for `PlainVectorIndex` search
2025-11-20 17:34:02 +07:00
Tim Visée
8bbeda5783 Add deferred flusher to Gridstore (#7446)
* Wrap the tracker and bitmask in Arc

* Implement deferred flusher for gridstore, defer tracker writes

* Remove clone

* Dynamically adjust list of pending updates to drain what is flushed

* Return proper flusher, defer premature Gridstore flushing errors

* Use deferred Gridstore flusher across storages

* Remove all Arc<RwLock<_>> wrappers around Gridstore in storages

* Flush pages inside closure, also wrap them in a lock

* Remove direct flush function from Gridstore

* Add test to assert behavior of deferred flushing in Gridstore

* Add much more extensive test, including concurrent flushes and deletes

* Add test for draining value pointer, make sure to drop when flushed

* Feature gate RocksDB components
2025-11-18 14:21:43 +01:00
Andrey Vasnetsov
ccabe47a08 more stop flags (#7531)
* add stopflag check into query_points of payload index

* propagate stopflag more

* fmt

* bench: compare better against no atomic

* use stoppable iter with IteratorExt

* clippy

* Add cancelled error helper

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: timvisee <tim@visee.me>
2025-11-14 10:58:04 +01:00
Arnaud Gourlay
204a27f3bc Fix missing version debug log (#7524)
* Fix missing version debug log

* we do not need curly braces where we are going
2025-11-12 17:18:44 +01:00
Roman Titov
6bca83c568 Cleanup edge_py::types::filter module (#7490)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-10 17:44:12 +01:00
Roman Titov
9aea6e1b95 Fix clippy 🙄 (#7486)
Co-authored-by: timvisee <tim@visee.me>
2025-10-31 12:59:27 +01:00
Tim Visée
c85c8db7fe Add repr(C) attribute to type used in MmapSlice (#7472) 2025-10-29 17:14:12 +01:00
Jojii
48d61f1719 Metrics vectors by name per collection (#7441)
* Add vector count per vector-name to metrics API

* Add to metrics API

* Improve TinyMap::get_or_insert_default and add tests

* Minor improvements

* Update openapi

* Review remarks

* Remove `collection_vectors` since it can be calculated manually
2025-10-29 17:00:53 +01:00
xzfc
3b55f856f4 Don't reuse links with vectors, optimize OldIndexCandidate::evaluate (#7467)
* links_empty

* Don't reuse links with vectors

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-29 13:27:30 +01:00
xzfc
5dcfaf1af6 Replace RwLock<BitVec> with BitVec<AtomicUsize> (#7468) 2025-10-29 11:56:57 +01:00
Andrey Vasnetsov
37b0f71e26 Move Query Context into shard crate (#7459)
* Move modifier to segment level

* write idf modifier into segment config

* fmt

* use proper query context in edge

* simplify init_query_context
2025-10-29 11:39:16 +01:00
Tim Visée
45579756cb Access vector_data without risk of panicking (#7469)
* Get vector data checked to prevent panic

* Add invalid vector name error helper
2025-10-29 10:35:12 +01:00
Andrey Vasnetsov
b037910c2f Implement logging of slow requests for scroll, facet, count, and retrieve (#7291)
* reorder arguments of scroll_by

* add slow request log for scroll request

* add slow request log for facet request

* add slow request log for count request

* add slow request log for retrieve request

* Remove obsolete clone

* generic implementation of Loggable for Arc

* Refactor scroll by arguments (#7296)

* separate internal scroll operation from the one used by user

* fmt

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-10-27 11:19:25 +01:00
xzfc
c1c9eb9ddb Add ACORN-1 search (#7414)
* GraphLayersBase::try_for_each_link

* Add FilteredScorer::score_points_unfiltered

* Add GraphLayersBase::search_on_level_acorn()

* Add SearchParams::acorn API parameter

* Integrate ACORN to HNSW search

* Add doc

* review fixes

* Misc fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-24 19:09:21 +00:00
Roman Titov
0281cd1952 Cleanups for shard crate and related stuff (#7445) 2025-10-23 20:24:21 +02:00
Tim Visée
27cf6e381e Improved segment flush ordering (#7381)
* Re-sort segments on flush, don't use proxy but inner segment state

* Also sort segments when proxying all segments for snapshot

The snapshot operation explicitly flushes segments. We therefore must
satisfy flush ordering there too.

* Add some helpful comments

* Add explicit flush ordering enum for segments

* Minor tweaks

* Fix spelling in comment

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-10-21 16:21:24 +02:00
Tim Visée
f106430225 Deduplicate iter_internal and iter_ids in ID trackers (#7428)
* Switch from iter_ids to iter_internal

* Remove iter_ids function

* Rename iter_ids_excluding to iter_internal_excluding
2025-10-21 10:25:54 +02:00
Kumar Shivendu
b8ac6741d4 Introduce replicate points action (#7063)
* Introduce new replicate points action

* fmt

* Introduce filter in shard transfer and new transfer method

* clippy & fmt

* Update OpenAPI specs and gRPC API

* Update gRPC docs

* Take from/to shard key as input for replicate_points

* update gRPC docs

* Make filters optional

* fmt

* clippy

* drop FilteredStreamRecords

* Add validation

* update gRPC docs

* Drop FIlteredStreamRecords

* clippy

* update openapi spec

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-20 22:45:52 +02:00
Andrey Vasnetsov
29a1197c4e derive Eq for Filter (and underlying types) (#7419)
* derive Eq for Filter (and underlying types)

* fix tests

* use ptr to compare and hash CustomIdChecker

* fix gpu test

* fmt

* use OrderedFloat directly

* post-rebase fixes

* fmt

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-10-20 17:27:03 +02:00
Luis Cossío
41a33167df [relevance feedback] Feedback in CollectionQuery (#7386)
* rename `NamedQuery::new_from_vector` -> `NamedQuery::new

* add feedback query in CollectionQuery. Extract pairs from feedback

* add tests

* fmt

* parameterize num pairs

* rename Linear to Simple

* follow refactor from base branch
2025-10-20 12:05:45 -03:00
Luis Cossío
63dff79edc [relevance feedback] add variant to query enum and internal service (#7368)
* add feedback variant to query enum and internal service

remove internal service Feedback structs for QueryEnum

* rename Linear -> Simple

* follow refactor from base branch

* remove outdated validations

* remove reintroduced code

* use explicit From
2025-10-20 10:52:43 -03:00
Andrey Vasnetsov
037c27200f use mutex to ensure sequential segment flushed + await on drop (#7416) 2025-10-17 13:49:55 +02:00
eltu
aa0f49798e Full-Text Index ASCII Folding (Normalization) (#7408)
* Add ASCII folding to tokenization process

Introduced an optional ASCII folding feature within the `TokensProcessor` to normalize non-ASCII characters to their ASCII equivalents. Updated tests and documentation to reflect the changes.

* Refactor tokenization code for improved readability and maintainability

Reorganized and reformatted the tokenization module, including `TokensProcessor` initialization and ASCII folding mappings for better clarity. Updated tests to align with the changes.

* Update test cases to reflect optional tokenizer settings changes

Adjusted `ascii_folding`, `lowercase`, and `phrase_matching` settings in tests to `None` where applicable, aligning with updates in tokenizer configuration defaults.

* address review remarks

* fix codespell

* thx coderabbit

* Don't copy tokens that are already ASCII

* Shrink folded string to fit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: timvisee <tim@visee.me>
2025-10-16 13:53:01 +02:00
xzfc
e640a78316 Refactor: merge _search_on_level into search_on_level (#7403)
* Call search_on_level instead of _search_on_level

* Inline _search_on_level into search_on_level

* Inline _search_on_level_with_vectors into search_on_level_with_vectors
2025-10-16 09:30:45 +00:00
Luis Cossío
163222930d Feedback query scorer (#7359)
* no manual impl for Serialize and Hash

* new feedback query

* construct query scorer

* simplify formula

* better comment

* make it easier to add other feedback formulas

* rename query -> target

* rename in async raw scorer

* rename formula -> strategy

* better comments

* rename to Simple strategy

* clippyyyyy

* oops, reenable conditional compilation

* Fundamental refactor to precompute pair score

* rename FeedbackScorer -> FeedbackQuery

This type implements `Query` trait, not `Scorer`.`
2025-10-15 10:31:18 -03:00
Andrey Vasnetsov
8b2d73ac19 address parallel flushing problem in snapshot creation (#7404)
* address parallel flushing problem in snapshot creation

* explicit flush in test
2025-10-14 18:28:25 +02:00
Andrey Vasnetsov
b8590a9a24 single thread flush (#7388)
* flush all segments in one thread sequentially

* bonus: move flush-related functions into dedicated file

* Minor comment tweaks

* await for flush on segment holder level

* fmt

* Minor improvement, preallocate vector for payload index flushers

* Remove invalid comment

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-14 16:39:28 +02:00
Andrey Vasnetsov
02de826748 fix segment repair on load (#7400)
* fix segment repair on load

* workaround for rocksdb

* Minor comment tweaks

* In in memory ID tracker, unset version first before dropping mapping

* rename cleanup_versions into fix inconsistencies

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-14 14:06:50 +02:00
xzfc
10ebd1851d Use fs_err::exists and fs_err::tokio::try_exists (#7401) 2025-10-14 09:16:55 +00:00
dependabot[bot]
03c1b607ad build(deps): bump jsonwebtoken from 9.3.1 to 10.0.0 (#7397)
* build(deps): bump jsonwebtoken from 9.3.1 to 10.0.0

Bumps [jsonwebtoken](https://github.com/Keats/jsonwebtoken) from 9.3.1 to 10.0.0.
- [Changelog](https://github.com/Keats/jsonwebtoken/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Keats/jsonwebtoken/compare/v9.3.1...v10.0.0)

---
updated-dependencies:
- dependency-name: jsonwebtoken
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump jsonwebtoken to 10.0, use rust_crypto backend

* Fix deprecation warning

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2025-10-14 10:49:50 +02:00
xzfc
95b4bbf978 Rename HnswConfig::{copy_vectors -> inline_storage} (#7389) 2025-10-13 10:08:06 +00:00
Arnaud Gourlay
a24d380ee0 Investigate flaky snapshot transfer test (#7339) 2025-10-09 10:47:23 +02:00
Andrey Vasnetsov
8dd915c0b1 non appendable proxies (#7345)
* WIP: make proxy segment non-appendable

* make deleted points and index changes private to Proxy Segment

* consistently remove empty unused segment from holder on unproxifying and the end of optimization

* remove/fix obsolete test

* Fix comment, some general adjustments

* Also don't remove non-original segments

* Use ahash for map of proxy index changes

* Inline format arguments

* Simplify has point branching

* Assert that proxy flushes to latest wrapped segment version

* make vector deletetion a CoW operation

* relax debug assertions

* Update lib/shard/src/proxy_segment/mod.rs

* fix test_partial_snapshot_empty

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-10-08 00:19:41 +02:00
Roman Titov
1004b93ae5 Python bindings for Qdrant on Edge (#7312)
* Qdrant Edge Python binding 🐍⛓️💥

* fixup! Qdrant Edge Python binding 🐍⛓️💥

Fix example + cleanup

* review: move QueryEnum + mark search as deprecated

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-03 12:48:26 +02:00
Arnaud Gourlay
159c7ffdb3 Force flush when taking a snapshot to capture on-going batches (#7342) 2025-10-02 13:33:15 +02:00
xzfc
23a0a0e8b8 DiffConfig: replace serde-based impl with explicit impl (#7294)
* refactor: replace serde-based DiffConfig implementation with macro

* refactor: macroexpand impl_diff_config

* refactor: drop `merge` dependency as unused
2025-09-29 18:55:50 +00:00
Roman Titov
895318913a Qdrant on Edge prototype (#7170) 2025-09-29 15:01:44 +02:00
xzfc
a0d62330c7 Use fs-err (#7319) 2025-09-29 12:47:10 +00:00
Andrey Vasnetsov
e86d60e6b0 slow requests log (#7188)
* wip: generalization trait for queries

* implement generalization for point operations

* fmt

* log priority queue

* wip: SlowRequestsListener

* fmt

* fix clippy

* simplify generalization

* fmt

* implement collection of requests profiles for update API

* implement API for viewing slow requests log

* add collection name to update worker

* add datetime to log

* fmt

* probabilistic counter of unique requests

* rename

* compute hash before converting into json value

* move logable out of generalizable

* fmt

* log query request

* fmt

* some fixes

* move measurement into local shard

* fmt

* upd openapi (not important)

* For enum variants, has discriminant

* Make SearchParams Copy

* Hash 0.0 and -0.0 the same

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Correctly hash enum variants and float values

* Hash through ordered float instead

* Fix priority queue not keeping longest request for hash

* SearchParams implements Copy

* Fix clippy warning

* Add unordered_hash_unique

* skip serialization if none

* Use OrderedFloat for hashing a float

* Use OrderedFloat for hashing a float

* only log updates if they are performed

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2025-09-19 19:59:25 +02:00
xzfc
22df6bc30a Integrate hnsw_with_vectors (#7232)
* StorageGraphLinksVectors::try_new, make GraphLinksVectorsLayout non-fallible

* Integrate hnsw_with_vectors

* remove unused function

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-09-18 17:36:48 +00:00