Commit Graph

151 Commits

Author SHA1 Message Date
Andrey Vasnetsov
ecca2850e8 rename batch update API name for consistency (#2595) 2023-09-05 12:54:13 +02:00
Tim Visée
5cb1fde9f4 Update .gitignore to ignore all generated OpenAPI definitions (#2593) 2023-09-05 11:25:25 +02:00
Andrey Vasnetsov
326ef54664 openapi definitions for shard shashots API (#2571)
* openapi definitions for shard shashots API

* review fixes
2023-09-04 14:54:08 +02:00
Tim Visée
2854127495 Add healthz, livez and readyz endpoints for Kubernetes (#2409)
* Add healthz, livez and readyz endpoints

* Describe healthz, livez and readyz endpoints in OpenAPI definition

* Add integration test for healthz, livez and readyz endpoints

* Fix typo
2023-09-04 10:57:42 +02:00
Tim Visée
547e602ee1 Limit vector dimension to 65536 (#2544)
* Limit vector dimension to 65536

* Add integration test for new dimension limit
2023-08-31 11:39:05 +02:00
Tim Visée
c2faf6c729 Fix missing points, vectors and payload (#2514)
* On segment flush, read-lock all segments to prevent CoW between flushes

For example, we have a point on an immutable segment. If we use a
set-payload operation, we do copy-on-write. The point from immutable
segment A is deleted, the updated point is stored on appendable segment
B.

Because of flush ordering segment B (appendable) is flushed before
segment A (not-appendable). If the copy-on-write operation happens in
between, the point is deleted from A but the new point in B is not
persisted. We cannot recover this by replaying the WAL in case of a
crash because the point in A does not exist anymore, making
copy-on-write impossible.

Locking all segments prevents copy-on-write operations from occurring in
between flushes.

* Return proper status on set payload operations in segment

* Disable propagating point deletions to its vectors, it looses vectors

* Update vector tests after disabling point delete propagation to vectors

* Implement retry with exponential backoff for read-locking all segments

* Use try_read_for rather than sleeping after lock attempts

* Simplify locking many, just lock one by one

Refs: <https://github.com/qdrant/qdrant/pull/2527>
Co-authored-by: generall <andrey@vasnetsov.com>

* Comment out now obsolete test

* Error handling in method getting segment locks by ID

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-31 10:03:51 +02:00
Tim Visée
4ba8abafaf Fix incorrect file URI handling in snapshot recovery (#2414)
* Fix URI to path conversion, respond with proper error if non existant

* Add integration test for snapshot recover from file URI errors
2023-08-10 13:50:11 +02:00
Tim Visée
1e4ce145a2 Parameterize integration tests (#2375)
* Clean up imports

* Clean up whitespace

* Use drop collection function from helpers

* Use parameterized integration tests to test on_disk variations

* Promote on_disk_vectors parameter into dedicated fixture

* Merge basic retrieve test with parameterization

* Flatten functions

* Split validation test functions

* Don't parameterize on_disk states when testing validation

* Parameterize init_from_collection test sequence

* Parameterize on_disk_payload in tests with fixture

* Parameterize new batch update tests

* Fix integration test collection setup distance after incorrect merge
2023-08-09 12:32:27 +02:00
Jesse
a9f9b7fcc9 Add batch update endpoint for points API (#1951)
* Add batch update endpoint for points API

* Add validation to batch update operation

* Update gRPC

* Add update and delete vector operations to point update batch

* Improve batch point update tests, add multivec, extract into module

---------

Co-authored-by: timvisee <tim@visee.me>
2023-08-07 16:16:41 +02:00
Arnaud Gourlay
99d9374d5d certifi 2023.7.22 (#2359) 2023-08-02 09:28:46 +02:00
Tim Visée
cf013c2b2f update collection: on_disk parameters (#2097)
* Add on_disk_payload field to collections params diff

* Add on_disk flag to update collection vector params

* Add on_disk parameters to collection update integration test

* Update and extend unit tests

* monitor on-disk params in optimizr

* fmt

* review fix

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-31 11:43:39 +02:00
Tim Visée
ef692499ee Update collection: quantization config (#2090)
* Reoptimize segments on quantization mismatch

* Add collection quantization params to collection update REST endpoint

* Do not require rebuild of quantization for on_disk change

* Add collection quantization params to collection update gRPC endpoint

* Add option to update vector specific quantization config to REST API

* Add option to update vector specific quantization config to gRPC API

* Update OpenAPI and gRPC specification

* Fix quantization mismatch detecting not working as expected

* Fix config mismatch optimizer not using vector specific quantization

* Add unit test for quantization in config mismatch optimizer

* Add some quantization params to collection update integration test

* Reformat

* Apply suggestions from code review

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

* Remove if-statement, simply return

* Move quantization params in named vector in integration test

* Test updating quantization params in multivec integration test

* Fix gRPC docs

* Fix quantization rebuild on changing enabled state on indexed segment

* allow disabling quantization config

* fmt

* clippy

* compare all params of the quantization for rebuild

* explicitly use params on update

* test for disabling quantization

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-28 19:48:08 +02:00
Andrey Vasnetsov
363aab5815 Fix for updating vector-specific config params (#2328)
* unit-test for updating multivec config

* Remove single vector support from vector params update in REST API

With this change, a user is always required to specify vector names when
updating their parameters. Updating vector parameters in a collection
with a single vector is still possible by providing an empty name. This
is very reasonable as updating vector parameters on a single vector
collection is a bad pattern, since parameters can be set on the
collection itself.

* Update integration tests to reflect REST API change

* Update OpenAPI specification

* Remove obsolete VectorsConfigDiff functions, update docs

* Update OpenAPI specification

* Add name validation to update collection endpoint for vector params

---------

Co-authored-by: timvisee <tim@visee.me>
2023-07-27 12:19:10 +02:00
Tim Visée
f551e73629 Update collection: vector HNSW config (#2087)
* Add update vector config type

* Add mutable getter to update vector config

* Add update vector config to update collection REST operation, reorder

* Add logic to update vector HNSW in collection

* Update OpenAPI specification

* If HNSW diff is empty, consider it as unset

* Update descriptions to clarify an empty HNSW diff unsets

* Make new vector HNSW diff update existing diff

This means that the existing vector HNSW diff is kept intact. Specified
fields are updated in the existing diff. An empty HNSW diff object may
be provided to unset the diff.

* Add update vector config to update collection gRPC operation

* Update gRPC docs

* Use vector specific HNSW config in integration test

* Extract & improve gRPC type conversions, fix collection update with None

* Validate vector specific HNSW config in collection update gRPC endpoint

* Explicitly test we do not rebuild on on_disk change

* Use new method to recreate optimizers

* Don't test on_disk change anymore

* Reuse collection write lock to save, do not relock

* Fix invalid update collection request body in OpenAPI test

* Simplify update collection test

* Add update collection test for HNSW parameters

* Extract vector param update logic into local functions

* Reformat

* Transform UpdateVectorParams into VectorParamsDiff

* Transform UpdateVectorsConfig into VectorsConfigDiff

* Combine serde attributes

* Make HNSW diff empty check generic over DiffConfig types

* Move DiffConfig implementation

* Fix typo
2023-07-25 12:19:59 +02:00
Tim Visée
4827a362e8 Update collection: HNSW config (#2083)
* Add field to REST collection update to change HNSW config

* Add field to gRPC collection update to change HNSW config

* Update OpenAPI specification

* Update gRPC docs

* Improve optimizer filtering for excluded segment IDs

* Add config mismatch optimizer detecting basic HNSW mismatches

* Trigger optimizers when changing collection HNSW config

* Make config mismatch optimizer aware of vector specific HNSW configs

* Extract triggering optimizers after collection update into function

* Add config mismatch optimizer test for changing HNSW config

* Simplify config mismatch optimizer test

* Add config mismatch optimizer test for vector specific HNSW change

* Reformat

* Update collection HNSW params in integration test

* Validate HNSW config in collection update gRPC endpoint

* Improve description of update collection request

* Do not require to rebuild HNSW when on_disk flag changes

Ref: https://github.com/qdrant/qdrant/pull/2083#discussion_r1231002072

* Do rebuild segment with on_disk change

* Trigger optimizers in parallel

* Recreate optimizers only once on collection update

* Reformat

* Fix incorrect usage of self

* Fix deadlock in collection state config update

* Also rebuild index on full scan threshold change

* decompose worst_segment condition check

* review refactor

* Update lib/storage/src/content_manager/collection_meta_ops.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

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

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* upd grpc docs

* upd grpc docs

* update openapi

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2023-07-18 14:32:13 +02:00
Andrey Vasnetsov
ed3750afe0 fix python scripts ci (#2283)
* fix python scripts ci

* fix sh script
2023-07-18 00:08:05 +02:00
Yaroslav Halchenko
6624c95afd codespell: workflow, config, typos fixed (#2248)
* Add github action to codespell master on push and PRs

* Add rudimentary codespell config

* some skips

* fix some ambigous typos

* [DATALAD RUNCMD] run codespell throughout

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* Add dev branch as target for the workflow
2023-07-12 16:30:42 +02:00
Luis Cossío
33afc616ce Expose & benchmark binary index (#2174)
* expose boolean index

* benchmark against keyword and no index

* add integration tests

* rename benchmark groups
2023-07-05 09:29:34 -04:00
Ivan Pleshkov
12423f910d Add missed vector preprocess (#2203)
* test missed preprocess after segment update

* missed preprocess

* remove preprocess_named_vectors fn

* are you happy clippy

* fix integration tests

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-05 00:30:15 +02:00
Andrey Vasnetsov
1093401353 run all integration tests with on_disk=true and false (#2125)
* run all integration tests with on_disk=true and false

* fix env reading
2023-06-21 21:09:34 +02:00
Andrey Vasnetsov
f2e1eb3914 more accurate check for collections compatibility (#2104)
* more accurate check for collections compatibility

* add tests

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2023-06-20 14:38:19 +02:00
Tim Visée
2d88f439f2 Bump requests from 2.28.1 to 2.31.0 in /openapi/tests (#1945)
* Bump requests from 2.28.1 to 2.31.0 in /openapi/tests

Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

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

* fix requests update

* reinstate buildx

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2023-06-07 20:23:23 +02:00
Luis Cossío
56712b5cc7 Lookup: expose feature to REST and gRPC interfaces (#2011)
* rename `Lookup` -> `RetrievedLookup`

* feat: expose lookup in groups

- make `with_vectors` and `with_payload` optional
- include in grpc
- move GroupId to inside of PointGroup message
- include `WithLookup` inside of `GroupRequest`, doesn't make sense to keep them separated

* chore: remove allow(dead_code) from builder

* feat: introduce `WithLookupInterface` to allow specifying only the name of the lookup collection

* fix: WithLookupInterface with collection name only brings all payload and vectors

* fix: update grpc docs

* add tests and set better defaults

* remove `RetrievedLookup` from proto

* short-circuit `fill_search_result_with_payload` when it's not needed

* cargo fmt

* proto: revert putting `GroupId` inside `PointGroup`

* update grpc docs

* Remove WithLookupInterface sugar from grpc

- set with_vectors of lookup default to false
- set with_payload of lookup default to true

* update integration tests

* use singular lookup

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-06-07 18:50:09 +02:00
Tim Visée
ca28bd07f1 Bump starlette from 0.26.1 to 0.27.0 in /openapi/tests (#1944)
Dependabot couldn't find the original pull request head commit, 7f8b1be2d712f4552c8b4cd2377149c8971b1516.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:40:50 +02:00
Andrey Vasnetsov
d8c6231228 remove outdated check (#1941)
* remove outdated check

* disable module fixtures
2023-05-22 23:15:41 +02:00
Andrey Vasnetsov
d624512a94 Fixes for group-by (#1938)
* fix payload seletor

* clippy

* except cardinality estimation

* implement match except iterator and api

* use except instead of must-not + test

* Fix doc error

* Update lib/collection/src/grouping/group_by.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

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

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

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

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

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

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

* Update lib/segment/src/vector_storage/mod.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/collection/src/grouping/group_by.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs [skip ci]

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* fix: `except_on` and `match_on` now produce `Vec<Condition>`s

* Apply suggestions from code review (lib/segment/src/index/field_index/map_index.rs)

* fix: reset review suggestion

* Remove unnecessary move

* Use Rust idiomatic map_else rather than match-none-false

* is-null -> is-empty

* de-comment drop_collection

---------

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>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2023-05-22 20:32:35 +02:00
Andrey Vasnetsov
60ce060a78 Rewrite nested filters again (#1935)
* working nested filters

* rm unused file

* add comment example

* todo

* remove nester checkers

* Box recursive generic Fn types

* Box recursive generic Fn types [2/2]

* Add optional ID tracker to check_payload, remove boxed closure (#1939)

* Add optional ID tracker to check_payload, remove boxed closure

* Replace some match with or_else

* Some nested filter improvements (#1940)

* Replace starts_with/substring with strip_prefix

* Transform for-if-let-check-return into any iterator

* Transform for-if-return into any iterator

* Add comment to describe why check_payload has no ID tracker

See: https://github.com/qdrant/qdrant/pull/1935#discussion_r1200437675

* Update lib/segment/src/payload_storage/query_checker.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Update lib/segment/src/payload_storage/query_checker.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* fix clippy

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2023-05-22 20:08:12 +02:00
Andrey Vasnetsov
5837460cfb one more test for optional vectors (#1925)
* one more test for optional vectors

* remove check

* clippy

* Add test retrieving non existing vector name

---------

Co-authored-by: timvisee <tim@visee.me>
2023-05-18 18:26:40 +02:00
Tim Visée
febe321ab4 Simplify/flatten point selection in delete vectors REST endpoint (#1898)
* Flatten points selector in delete vectors REST endpoint

This makes the vector deletion API consistent with other endpoints using
the point selector.

* Update tests for flattened delete vectors point selector

* make api consistent with existing ones

* update openapi

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-16 18:15:57 +02:00
Tim Visée
e3bc58d0f3 Add integration test for error when updating vectors on unknown point (#1899) 2023-05-16 15:23:30 +02:00
Luis Cossío
e70a80add7 CI: make integration tests 45% faster (#1902)
* use scope="module" where possible

* refactor test_snapshot.py to use loop and timeout instead of long waits
2023-05-16 15:23:03 +02:00
Luis Cossío
e90a03e00b Group by key (#1768)
* test: test must_not is_null

* vcs: ignore vscode files

* feat: group-by initial implementation

* cargo fmt

* refactor: same request behavior on reco and search

* refactor: get rid of RefCell

* refactor-fix: correct hashmap keys, and early stops

* chore: small improvements

* feat: groups aggregator

* fix: pull changes from other files

* cargo fix

* cargo fmt

* docs: edit docstrings

* allow dead code (while the complete feature is beint built)

* chore: restructure

* feat: introduce GroupKey, minor other improvements

* cargo fmt

* chore: specify aggregator visibility

* fix: oops, leaking "private" type

* refactor-fix: restructure and refactor group_by

* cargo fix

* fix: don't panic when there is no group-by field

* remove print statements

* amend: `>=`  -> `==`

* perf: remove double clone

* chore: sync aggregator from other branch

* chore: cleanup print statemets

* test: ignore big tests

* cargo fmt

* refactor: add early stop when the groups have been filled, improve code

* chore: sync aggregator, remove print from test

* refactor: consider shard_selection, improve collection_by_name handling

* feat: add bucketing to table of content

* refactor: better errors, improve tests

* test: add integration tests

* feat: add endpoints

* refactor: introduce ScoredPoint wrapper, restructure types

* sync aggregator

* edit internal grouping visibility

* feat: group_by internals

* cargo fmt

* cargo fmt

* refactor: turn inner fn into closure

* test: fix test to support new vector output representation

* feat: wire up grouping with actix

* expose grouped_by field

* fix: change output group format

* feat: wire up openapi

* fix: finish wiring up grouping in actix

* tests: fix test_group.py

* cargo fmt

* refactor: extract constants

* remove Hash from ScoredPoint

* `Option<collection_by_name>` -> `collection_by_name`

* fix: handle better cases on `match_on`

* fix: consider that subsequent calls can bring better results

* cargo fmt

* fix clippy warnings

* cargo fmt

* refactor: move `Group` to `types`, localize `hydrate_from`, remove `Deref` impls

* refactor `add_points`

* refactor: turn `GroupKey` into enum

* refactor: make `HashablePoint` inner struct private

* feat: add grpc layer, make new `PointGroup` type to use as output

* fix: update openapi models

* docs: update grpc docs

* fix merge errors

* refactor: add BaseGroupRequest to make code DRYer, improve doc comments

* cargo fmt

* perf: increase precision; choose best groups by score

* misc: add more integration tests, fix review comments

* cargo fmt

* fix: reimplement interface to flatten search and recommend requests, excluding offset

* cargo fmt

* refactor: move `r#do` impl to `GroupRequest`

* fix: update grpc docs

* perf: sort in reverse order

* fix: use fist value of a Value::Array

* fix: validate group_by to not support bracket notation, fix int. tests

* fix: update grpc validation

* tests: update collection_tests

* refactor: move validation to the api layers

* Oops: reupdate tests

* refactor: let the derives derive (thanks @ffuugoo)

* refactor: use a new GroupId on the output

also increases performance by copying less

* remove hashable set, take ordering into an account, fix mutliple groups values support

* fmt

* refactor group_id + rename per_group -> group_size, fix clippy

* remove GroupKey wrapper

* @agourlay review fixes

* refactor: `group_min_scores` and `group_max_scores` ->  `group_best_scores`

* refactor: use set difference on `keys_of_unfilled_best_groups`

* refactor: use set intersection on `len_of_filled_best_groups`

* refactor: turn best_group_keys into iterator

* fix: remove [] syntax limitation

* fix: update openapi.json

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-15 23:05:20 +02:00
Arnaud Gourlay
a18f5e9802 Nested object filter (#1602)
* nested object filter

* code review

* add support for must_not in nested

* extract functions

* support and test must_not in SimpleConditionChecker

* add index matching unit test (to be continued)

* remove extra clone

* test with should

* WIP: Nested object filter suggestions (#1855)

* switch to bitvec

* fix clippy

* more tests

* fmt

* fix some tests

* add test with text

* support for nested should

* do not rely on indexes for nested queries & fix test

* use index to make index-aware checks in nested payload

* fix value-count tests

* re-fa-cto-ring

* fmt

---------

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

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-10 14:20:12 +02:00
Tim Visée
65ff1b66ea Add integration tests for REST update/delete optional named vectors (#1837)
* Add integration test for optional named vector update/delete endpoints

* Update optional named vector integration tests for API change

* Fix update vectors endpoint not validating inner vectors

* Fix failing test due to unspecified order
2023-05-05 18:45:37 +02:00
Tim Visée
eb794795d6 Add REST interface to update/delete optional named vectors (#1836)
* Add update/delete REST endpoints

* Add update/delete vector REST endpoints to OpenAPI specification

* Fix update vector with no changes not triggering a validation error

* Update OpenAPI specification for updated request type
2023-05-05 16:10:46 +02:00
Luis Cossío
d89d2ec24b Disable indexing and memmap with 0 (#1824)
* feat: use 0 as disable for indexing and memmap

* amend: edit test, update doc comments, remove validation

* fix: use constant instead of literal, reword doc comments

* test: update test for loop and timeout

* fix: remove validation on OptimizerConfigDiff and fix test_validatioin.py

* fix: remove validation from build.rs, remove internal hack from  doccomments

* fix: update grpc docs

* revert max_optimization_threads validation in test

* update config comments and minor test change

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-05 10:10:35 +02:00
Arnaud Gourlay
e0fe29a9f4 Support Array of Scalars in JsonPath extractor (#1784) 2023-04-26 07:55:04 +02:00
Luis Cossío
1840d8ff08 Fix flaky integration telemetry test (#1766)
* test: fix time deserialization

* fix: bump python version and re-freeze requirements
2023-04-21 15:37:09 -04:00
Luis Cossío
abbe6bf5a9 Allow indexing_threshold=null to disable indexing (#1702)
* feat: allow indexing_threshold=null to disable indexing

* fix: continue refactor

* amend: continue refactor

* amend: restore docstring

* update openapi.json

* test: add sanity test

* test: refactor test
2023-04-15 00:03:13 +02:00
Luis Cossío
7af32ec2b7 feat: [http] alias with_vector <-> with_vectors (#1697) 2023-04-11 18:19:40 +02:00
Tim Visée
f5a14449a0 Add vector specific quantization configuration (#1680)
* Add QuantizationConfigDiff type

* Add quantization config diff to vector parameters

* Prefer vector config over collection config for quantization

* Update OpenAPI specification

* Validate quantization configuration quantile in 0.5-1.0 range

As per https://github.com/qdrant/qdrant/pull/1681

* Add test if check if vector specific quantization config is persisted

* Alias quantization to quantization_config in vector parameters

* Remove quantization config diff, use full vector specific config instead

* Regenerate OpenAPI specification and gRPC docs

* Fix compilation error

* Add error handling to quantization config conversions

* Fix quantization integration test, make HNSW test stricter
2023-04-10 21:39:43 +02:00
Luis Cossío
139d3eb1e2 Include "last_responded" in telemetry (#1668)
* feat: include "last_queried" in /telemetry

* fix: anonymize responses in the WebApiTelemetry and GrpcTelemetry Anonymize impls

* fix: anonymize the last_queried field

* fix: use YYYY/MM/DD hh:mm:ss format on 'last_queried'

* tests: add and fix telemetry test

* refactor: rename last_queried -> last_responded

* cargo fmt

* update openapi models

* refactor: rename last_request_time -> last_response_date

* tests: update test

* review changes

* add chrono to schemars

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-10 20:20:00 +02:00
Tim Visée
b7c1ecfd5f Add vector specific HNSW configuration (#1675)
* Validate VectorConfig/VectorParams, remove obsolete validation

* Add HNSW config diff to vector parameters

* Validate params in collection config

* Add HNSW config to segment vector data config

* Add VectorsConfig params iterator for more elegant conversions

* Prefer vector HNSW config over collection config for building HNSW index

* Base segment vector param HNSW config on collection config

* General improvements

* Rewrite HNSW ef_construct extract function to also consider vector configs

* Update OpenAPI specification

* Add test to check if vector specific HNSW config is persisted

* review changes

* review changes

* Regenerate gRPC docs

* Fix test on Windows

* Regenerate OpenAPI specification

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-10 17:16:56 +02:00
Arnaud Gourlay
c412e0ae3d cleanup and document openapi issue (#1665) 2023-04-05 13:15:01 +02:00
Andrey Vasnetsov
b73335259f Restore is empty functions as before (#1657)
* is_empty should match with value=null

* fmt
2023-04-04 12:17:07 +02:00
Alex Huang
d1e5498ff8 feat: add wait param for all snapshot API (#1571)
* feat: add wait parm for all snapshot API

* update openAPI

* avoid unwrap

* remove all unwarp

* return HTTP 202 when no waiting on snapshot creation

* return 202 when non wait

* update open API

* update param on python test

* update and test api

* optimize the test

* return 202 when non-wait delete

* recover fixes

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-04 12:08:13 +02:00
Ivan Pleshkov
4635481492 Add Actix and config validation (#1463)
* actix validation

* add check for memmap/indexing_threshold

* fix actix json settings

* Validate settings configuration on start, print pretty warnings on fail

* Add more validation rules for settings and nested types

* Move shared validation logic into collection/operations

* Show validation warning in log when loading some internal configs

* Show prettier actix JSON validation errors

* Stubs for pretty handling of query errors, reformat validation errors

* Use crate flatten function, the hard work was already done for us

We don't have to flatten validation errors into their qualified field
names ourselves because there is a utility function for this.

* Configure actix path validator

* Actix endpoints don't require public

* Extend validation to more actix types

* Validate all remaining actix path and query properties

* Rephrase range validation messages to clearly describe they're inclusive

* Validate all query params to respond with pretty deserialize errors

* Nicely format JSON payload deserialize error responses

* Improve error reporting for upsert point batches

* Add basic validation test that checks a path, query and payload value

* Add some validation constraints

* Add simple validation error render test

* Update Cargo.lock

---------

Co-authored-by: timvisee <tim+github@visee.me>
2023-04-03 09:43:55 +02:00
Ibrahim M. Akrab
f85ae02ab6 add isNull condition for payload filtering (#1617)
* add minimal working is_null filter

* add is_null condition to grpc api (backward compatible)

* add unit tests is_null and is_empty conditions

* add is_null to  points.proto file

* add some failing OpenAPI tests

* fix a failing test due to change in collection data

* refactor MultiValue's check for is_null

* fix is_empty condition not picking up "key":[]

* remove duplicate OpenAPI integration test

* reuse same variable in condition checker tests

* update grpc docs

* fix is_null cardinality estimation to match is_empty

* update openapi specs

* remove unused debug statements

* add new test points to original test_collection

* fix failing tests according to newly added points

* add the `"key":[null]` test_case
2023-04-01 20:46:50 +02:00
Tim Visée
91a0200c1b Improve metrics building performance, limit endpoints to whitelist (#1616)
* Fix incorrect metrics value for cluster commit

* Rewrite metrics logic, don't use registry, write values directly

* Only report REST timings for requests having HTTP 200 response

* Limit metrics reporting of endpoints to whitelist

The whitelist contains a selection of search, recommend and upsert endpoints.

* Add MetricsParam, remove detail level, keep anonymize

* Request metrics in basic API test

* Specify content type for metrics endpoint

* Add OpenAPI test for metrics endpoint, remove from basic API test

This test probes for some strings that must exist in the output

* Add note that metrics endpoint whitelist must be sorted
2023-03-29 13:08:06 +02:00
Ibrahim M. Akrab
f8e6c58a84 add upload snapshot functionality using multipart request (#1578)
* add upload snapshot functionality using multipart request

* remove unnecessary printing

* Add proper error handling

* add snapshot upload integration tests

* Fix maximum uploaded snapshot size limit

* review changes

* update OpenAPI with upload endpoint

* add missed query param in openapi

* remove unused function

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-21 17:17:25 +01:00