Commit Graph

112 Commits

Author SHA1 Message Date
Andrey Vasnetsov
f0b139f765 implement custom collection metadata (#7123)
* implement custom collection metadata

* persist metadata change

* Also unset a key in the test

---------

Co-authored-by: timvisee <tim@visee.me>
2025-08-26 13:20:08 +02:00
Andrey Vasnetsov
0ce667eee5 filter text any (#7100)
* internal implementation for filter any

* implement api for match `text_any`

* allow naive implementation of text match any

* dedup after kmerge + renames

* improve `expected_should_estimation`

* congruence test

* openapi test

* setup index in each test

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-08-26 13:18:36 +02:00
Andrey Vasnetsov
9c8ef5574f Update if (#7006)
* implement condition parameter for upsert operation

* fmt

* update api schema

* implement conditional update for update-vectors op

* rename to update_filter for consistency

* add tests

* explicilty ignore strict mode for conditional updates

* rabbit review fix

* Also assert vector element before, confirm we don't normalize

* Simplify filter creation using new helper

* Rename merge_with_ids to with_point_ids

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-08-26 13:16:18 +02:00
Jojii
6ae07f0fd8 Always load InferenceService (#7050)
* Always load InferenceService

* Add BM25 openapi test

* Add warning to development.yaml config (#7051)
2025-08-14 14:30:26 +02:00
Tim Visée
60c216be92 Preprocess query vectors, sort sparse vectors (#6895)
* Add test to assert behavior of unsorted sparse query

* Preprocess sparse vectors

* Fix typo
2025-07-17 16:13:01 +02:00
Tim Visée
877adc6748 Fix broken is_empty filter on new points (#6882)
* Add test to catch bug

Bug: <https://github.com/qdrant/qdrant/issues/6880>

* Fix loading null index from wrong path

* Simplify test

* Also bump total point count when removing a point

* Add debug assertion, ensure we don't create null index in selector

* Update bug link

* Remove unused import

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

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-07-17 14:01:38 +02:00
Luis Cossío
e8daf9c79f [MMR] expose as query variant in rest and grpc (#6797)
* expose mmr in rest and grpc

* fix referenced vectors in mmr queries

* rename to MmrInput in grpc for consistency

* mmr is now an optional parameter of nearest query

* fix score_threshold at local shard

* fix conversion of rest -> collection

* fix and refactor planned query

* nits

* rename `lambda` to `diversity` in interface

* handle score_threshold within mmr calculation

* add openapi test

* fix candidate limit at collection level

* candidate_limit -> candidates_limit

* finish rename to candidates_limit

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-17 13:56:46 +02:00
Andrey Vasnetsov
6bc7f9c650 fix check for pure primary condition filter (#6840)
* fix check for pure primary condition filter

* avoid cloning has_id for primary condition

* fix test

* add test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-07-17 13:54:43 +02:00
Arnaud Gourlay
afe4daa38d Deleted leftover test openapi collections (#6788) 2025-07-17 13:38:30 +02:00
Luis Cossío
ad936a463c [phrase matching] expose phrase condition (#6670)
* add `"match": { "phrase": ... }` condition

* gen grpc and openapi

* [phrase matching] expose `phrase_matching` flag in rest and grpc (#6620)

* expose setting in rest and grpc

* phrase matching openapi test

* regen openapi

* [phrase matching] Text index fixes (#6730)

* allow rocksdb-based immutable text index

* fix repeated-token phrases

* fmt

* Update OpenAPI spec

---------

Co-authored-by: timvisee <tim@visee.me>

* add repeated word case in openapi test

* [phrase match | strict mode] Allow phrase condition when enabled in index (#6749)

* allow phrase filter when index is present

* prettier error message

* clippppppy

---------

Co-authored-by: timvisee <tim@visee.me>
2025-07-17 13:25:12 +02:00
Roman Titov
2aafd0174d Add partial snapshot create requests count and recovery timestamp to telemetry (#6545)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:27:14 +02:00
Arnaud Gourlay
dd97253fe9 Strict mode allows fullscan for multitenant payload index (#6498)
* Strict mode allows fullscan for multitenant payload index

* different error for missing payload index in multitenant case

* handle payload_m

* add simple test

* handle hnsw.m not set

* add another simple test

* fix test

* fallback to global HSNW config

* new error status code

* do not block on global HNSW and improver error reporting

* clearer error reporting

* review fixes

* fix test error messages

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:26:16 +02:00
Arnaud Gourlay
bbc4beb9ec Fix UnindexedField infra to handle lookup&range index requirements (#6496)
* Fix UnindexedField infra to handle lookup&range index requirements

* more generic approach

* better test

* restore

* small unit test for sanity

* review nits

* Do not recommend parametrized index

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-05-22 23:24:10 +02:00
Andrey Vasnetsov
7872c182f1 Strict mode error is now 400 instead of 403 (#6560)
* strcit mode error is now 400 instead of 403

* fix test
2025-05-22 23:22:16 +02:00
Arnaud Gourlay
9b99408529 Always overwrite existing payload on upsert (#6533)
* Always overwrite existing payload on upsert

* Add REST tests
2025-05-22 23:17:18 +02:00
Arnaud Gourlay
eaaa4e4ee1 Validate IntegerIndexParams (#6494)
* Validate IntegerIndexParams

* focus
2025-05-22 23:00:52 +02:00
Arnaud Gourlay
00e7ffa9b3 Strict mode detects full scan on query (#6473) 2025-05-22 22:59:16 +02:00
Arnaud Gourlay
1da478c897 Fix strict mode unindexed group_by path (#6363)
* Fix strict mode unindexed group_by path

* check index schema for matching support

* Handle disabled lookup on integer index
2025-05-22 22:56:24 +02:00
Arnaud Gourlay
4c7c730c97 Log context of openapi validation crash (#6448) 2025-05-22 22:52:50 +02:00
Arnaud Gourlay
15d674d0c0 Fix warning regarding missing wait param in openapi tests (#6434) 2025-05-22 22:50:58 +02:00
Arnaud Gourlay
377b614e1e Fix flaky test formula (#6429) 2025-05-22 22:49:44 +02:00
Luis Cossío
a304a51f84 [rate limits] consider length of multivectors for query cost (#6356)
* consider length of multivectors for rate limiter

* add openapi test

* organize imports

* better cost estimation for sparse vectors

* restore groups openapi test

* address @timvisee's review

* Fix consensus test
2025-05-22 22:46:39 +02:00
Kumar Shivendu
83af9cf3ba Improve telemetry logic and test (#6399)
* Improve telemetry logic and test

* Parametrize telemetry test

* Consistency hash peeer ID across telemetry

* clean test

* Use Option in segments telemetry

* updat openapi spec

* Avoid test failure on change in order of params
2025-04-21 00:12:26 +02:00
Andrey Vasnetsov
bbea80e7d4 Telemetry improvements (#6390)
* allow shard states in anonymize telemetry (with hashed peer ids)

* introduce level3 and level4 for telemetry, where level4 = everything, incl. segments info

* upd openapi

* fix tests

* expose vector count & size stats on shard level to avoid reading of segments

* fix spelling

* upd schema

* fix tests

* Use unwrap_or_default

* [#6390] skip serializing shard details in Level2 (#6398)

* skip serializing shard details in Level2

* upd openapi

---------

Co-authored-by: generall <andrey@vasnetsov.com>

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2025-04-21 00:10:28 +02:00
Luis Cossío
156c79ebdc [query api] don't propagate offset into prefetches (#6357)
* don't propagate offset into prefetches

* I want to see CI with that change

* Move import into platform specific scope

* edit test to make sure offset is not propagated

* fix planned query test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: timvisee <tim@visee.me>
2025-04-20 23:59:01 +02:00
Arnaud Gourlay
b1b27c088a Fix strict mode query limit for distance matrix API (#6354) 2025-04-20 23:58:02 +02:00
Arnaud Gourlay
e4400c6051 Fix strict mode query limit for group APIs (#6353) 2025-04-20 23:55:48 +02:00
Arnaud Gourlay
841048bbd2 Read rate limiter charge per filter condition (#6333) 2025-04-20 23:53:17 +02:00
Arnaud Gourlay
db7dcda044 Rate limit retrieve based on number of ids (#6327)
* Rate limit retrieve based on number of ids

* fmt

* Better test
2025-04-20 23:52:54 +02:00
Luis Cossío
317f1e0dbe [strict mode | score boosting] Strict mode for formula queries (#6317)
* move problems.rs to collection crate

* change type on datetime_key expression

* extract from expression

* check for unindexed fields in formula

* clippy

* dedup code

* Only implement verification for `CollectionQuery` types (#6319)

* verify CollectionQuery's Prefetch

* remove implementation for REST query

* remove implementation for REST query groups

* add basic openapi test
2025-04-20 23:52:36 +02:00
Arnaud Gourlay
6e2191fcae Document Multivector Euclidean scoring discrepancy (#6320) 2025-04-20 23:52:28 +02:00
Arnaud Gourlay
6518a053c9 Rate limite recommendation based on number of examples (#6324) 2025-04-20 23:52:11 +02:00
Andrey Vasnetsov
1bbe483877 decrease collection probability (#6224) 2025-03-31 16:17:46 +02:00
Luis Cossío
0184e2d390 [score boosting] Error on unexpected type (#6187)
* helper for getting payload value

* Error instead of silent default

* fix clippy

* fix openapi test
2025-03-21 11:45:42 +01:00
Arnaud Gourlay
f5e35f9805 Write rate limit batch update per point count (#6152) 2025-03-21 11:43:26 +01:00
Arnaud Gourlay
aa10df0fe4 Unset strict config fields (#6120) 2025-03-21 11:42:46 +01:00
Andrey Vasnetsov
706b1a3166 IsEmpty/IsNull index (#6088)
* create initial strucutres

* clippy

* start field-query refactoring

* start field-query refactoring (2/N)

* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition

* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet

* filter for is_empty/is_null

* implement add/remove point

* upd schema

* open and create of null-index

* create null-index

* fix test

* Update lib/segment/src/index/query_optimization/condition_converter.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

* unit test for null-index

* more unit tests

* add openapi tests

* fmt

* fix for integartion tests

* rabbit review fix

* make [null] non-empty

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-21 11:41:12 +01:00
Luis Cossío
1a23ebc4b9 [score boosting] openapi test for formula (#6064)
* add formula to internal grpc api

* add openapi test for formula
2025-03-21 11:40:07 +01:00
Arnaud Gourlay
cb1f3220df Add strict mode for max points count (#5967)
* Add strict mode for max points count

* clarify estimated nature
2025-02-17 10:20:50 +01:00
Arnaud Gourlay
27d5b39aee Retry-After on rate limiter hit for REST API (#5917)
* Retry-After on rate limiter hit for REST API

* fix tests

* Ceil retry after seconds number so clients don't retry too early

* Relax retry after time requirement a bit in case CI machines are slow

* Add rate limit test, test retry after if we replanish within a second

* Report time to wait in rate limit error

---------

Co-authored-by: timvisee <tim@visee.me>
2025-02-11 14:41:44 +01:00
n0x29a
00933d07ae Strict mode sparsevector (#5841)
* Strict mode sparse vectors
* Update gRPC docs
* Use deny_unknown_fields (#5868)

---------

Co-authored-by: n0x29a <n0x29a@example.com>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-27 18:25:34 +01:00
Arnaud Gourlay
0140eb83fc Strict mode multivector (#5757)
* strict mode for multivector

* simplify impl

* regen docs
2025-01-23 14:28:01 +01:00
Arnaud Gourlay
6678050332 API validation for unique dense and sparse vector names (#5808)
* API validation for unique dense and sparse vector names

* less alloc

* test empty name as well

* quotes instead of ticks
2025-01-16 10:52:00 +01:00
Arnaud Gourlay
bd882fde54 Migrate strict mode payload test for mmap (#5793) 2025-01-16 10:50:46 +01:00
Jojii
b870f96513 [Strict mode] limits for filter and conditions (#5754)
* Add limits for filter and conditions

* clippy

* Review remarks + nested condition test

* Fix opnapi specs

* Improve error message by giving info about limits and usage
2025-01-16 10:50:36 +01:00
Jojii
cb8667a7ae Merge pull request #5729
* Consider filter-cardinality as cost in update ratelimiter

* Use OperationEffectArea and improve rate limit error message

* Clippy

* Fix test
2025-01-16 10:49:14 +01:00
Arnaud Gourlay
3d3f8c104e Reshape read rate limiter and fix disabled mode (#5683) 2025-01-08 14:08:41 +01:00
Arnaud Gourlay
d3f2b8e79c Fix rate limiting of internal update operations (#5653)
* Fix rate limiting of internal update operations

* code review

* write_rate_limiter turned Option<Mutex> and fix disabling mode

* Update TODO tag

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-01-08 14:08:29 +01:00
Arnaud Gourlay
947e79e054 Strict mode for payload storage (#5588)
* Strict mode for payload storage

* Don't increment counter multiple times per request

* Add (loose) integration tests for payload storage limit

* Minor improvements

* minor renaming

* Update lib/api/src/grpc/proto/collections.proto

Co-authored-by: Tim Visée <tim+github@visee.me>

---------

Co-authored-by: jojii <jojii@gmx.net>
Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-01-08 14:07:24 +01:00
Arnaud Gourlay
993121b3ea Rate limit requests per minute (#5597)
* Rate limit requests per minute

* rename to remove time unit for API
2025-01-08 14:01:28 +01:00