Commit Graph

40 Commits

Author SHA1 Message Date
Luis Cossío
4ac3c6a867 feat: [http] alias with_vector <-> with_vectors (#1697) 2023-04-11 18:21:33 +02:00
Tim Visée
868626f409 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-11 14:31:34 +02:00
Luis Cossío
e1d494d6be 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-11 14:31:28 +02:00
Tim Visée
66ba8f17af 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-11 14:31:18 +02:00
Arnaud Gourlay
7657d79f0d cleanup and document openapi issue (#1665) 2023-04-11 14:29:55 +02:00
Andrey Vasnetsov
e43e24deb2 Restore is empty functions as before (#1657)
* is_empty should match with value=null

* fmt
2023-04-11 13:46:16 +02:00
Alex Huang
de93c75bf3 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-11 13:42:11 +02:00
Ivan Pleshkov
f0f92292e0 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-11 13:41:06 +02:00
Ibrahim M. Akrab
2ddce557b2 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-11 13:40:59 +02:00
Tim Visée
13c9a679b2 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-04-11 13:39:41 +02:00
Ivan Pleshkov
97fafce25f Fix values count loading in geoindex (#1563)
* fix values count loading in geoindex

* WIP: fix loading statistics in geo-index

* WIP: fmt

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-15 16:30:35 +01:00
Andrey Vasnetsov
8775fdc8d8 improve validation for aliases (#1549)
* improve validation for aliases

* fmt

* Update openapi/tests/openapi_integration/test_alias.py

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

* Update openapi/tests/openapi_integration/test_alias.py

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-03-15 16:28:55 +01:00
Arnaud Gourlay
a93a55e900 Fix condition check for values_count (#1502) 2023-03-15 16:24:25 +01:00
Arnaud Gourlay
3d8b5131bd Nested payload filters (#1487)
* Nested payload filters

* close ToDo + add parsing of multuiple array values

* fmt

* improve testing nested arrays

* fix NumericIndex to accumulate points_to_values mapping

* revert numberic index + strict array field access

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-15 16:24:04 +01:00
Luis Cossío
c414a77105 feat: add "any" to "match" statements (#1466)
* feat: add "any" to "match" statements

Adds support for using "any" to match on a list of different possible values

* enable proper counting in cardinality estimation

* fmt

* upd OpenAPI

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-15 16:20:11 +01:00
Arnaud Gourlay
fe06844c48 Delete snapshots API (#1377)
* Delete snapshots API

* remove unecessary plurals
2023-02-06 15:16:33 +01:00
Arnaud Gourlay
25d1383496 List aliases API (rest & gRPC) (#1363)
* List aliases API (rest & gRPC)

* rework api to avoid conflicts
2023-02-06 15:15:52 +01:00
Andrey Vasnetsov
a1f651fbd6 Recommendation with other collection (#1283)
* WIP: move recommendation API out of collection

* recomendations with external source of vectors

* fix test

* fmt

* fixes + test

* review fixes
2022-12-25 22:51:36 +01:00
Andrey Vasnetsov
469c098ca4 Update points by filter (#1249)
* allow to set remove payload by selector

* fmt
2022-12-06 15:02:33 +01:00
Andrey Vasnetsov
0d130c395a Full payload update (#1245)
* implement api to fully overwrite payload of the point

* fmt
2022-12-06 15:02:02 +01:00
Andrey Vasnetsov
2b4ab27506 Write lock for user requests (#1143)
* lock update operations only

* fmt

* fix

* lock openapi integration test
2022-10-19 12:57:52 +02:00
Andrey Vasnetsov
dc07b01e1f remove deprecated fields from API (#1030)
* remove depricated fields from API

* fmt

* upd openapi and integration tests

* fix grpc test

* regenerate storage reference data

* improve docs

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-09-19 13:51:03 +02:00
Ivan Pleshkov
4d3b4b132d More multivector api updates (#1025)
* rest multivector api updates

* update openapi

* update grpc doc
2022-09-16 12:25:42 +04:00
Ivan Pleshkov
22fd3a3963 minor doc and api in tests updates (#1022) 2022-09-15 13:37:38 +04:00
Ivan Pleshkov
f6b2186193 [WIP] Many named vectors per point (#958)
* many named vectors per point (segment-level)

* operation result for dim function

* beautifulized vector name

* fix naming bug

* segment version migration

* fmt

* add segment tests

* are you happy clippy

* fix build

* [WIP] many named vectors per point (collection-level) (#975)

* config and search

* fix placeholders for proxy segment move

* remove VectorType from collection

* are you happy fmt

* vectors in grps messages

* create collections with vectors

* segment holder fixes

* are you happy fmt

* remove default vector name placeholders

* are you happy fmt

* are you happy clippy

* fix build

* fix web api

* are you happy clippy

* are you happy fmt

* record vector&vectors

* openapi update

* fix openapi integration tests

* segment builder fix todo

* vector names for update from segment

* remove unwrap

* backward compatibility

* upd openapi

* backward compatible PointStruct

* upd openapi

* fix record back-comp

* fmt

* vector configuration backward compatibility

* fix vetor storage size estimation

* fmt

* multi-vec segment test + index test

* fmt

* api integration tests

* [WIP] Named vectors struct (#1002)

* move to separate file

* named vectors as struct

* use cow

* fix build

* keys iterator

* avoid copy in PointStruct -> get_vectors

* avoid another copy

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

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-09-11 20:59:23 +02:00
Andrey Vasnetsov
b9eee55a9f Full text search (#963)
* allow additional params for payload field index

* fmt

* wip: full text index building

* fmt

* text search request

* text search request

* full text index persitance and loading

* fmt

* enable fts index in mapping

* clippy

* fix tests + add integration test

* review fixes: extend payload index test

* revert incedental change
2022-09-01 12:50:12 +02:00
Andrey Vasnetsov
098bc4c751 Count api (#777)
* count api

* test for approx counting

* fmt + clippy

* unit test

* add warning
2022-07-05 09:33:38 +02:00
Andrey Vasnetsov
83c21450c3 Pagination (#743)
* offset param for search and recomendation

* test and fix for pagination

* clippy + fmt

* upd schemas

* fix grpc requests in test
2022-06-27 13:22:02 +02:00
Andrey Vasnetsov
1b458780eb On disk payload storage (#634)
* implement on-disk payload storage

* fmt + clippy

* config param for on-disk payload storage

* upd openapi definitions

* add integration test with on-disk payload

* fix clippy

* review fixes

* fmt
2022-06-01 17:23:34 +02:00
Andrey Vasnetsov
5800319edb refactor distances + add score_threshold + fix negative euclid distance (#569)
* refactor distances + add score_threshold + fix negative euclid distance

* generate docs

* fix clippy

* Update lib/segment/src/spaces/tools.rs

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

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-05-09 17:32:48 +02:00
Andrey Vasnetsov
6af867e037 fix and extend interation test for scrolling over points (#494) 2022-04-20 09:52:59 +02:00
Andrey Vasnetsov
b07428f620 Is empty condition (#423)
* is-empty condition

* fmt

* better assert

* fmt
2022-04-03 16:55:51 +02:00
Andrey Vasnetsov
adc1f4ad97 Bool filter (#421)
* bool match condition

* use generic values for match requests

* fmt

* upd grpc interface

* upd grpc docs
2022-04-03 16:08:34 +02:00
Arnaud Gourlay
2a81fc9142 Remove sled for alias mappings (#402)
* improve alias tests

* introduce new alias persistence and remove Sled

* introduce FileStorageError

* use new error in AliasMapping

* aliases are kept in memory and saved to disk when modified

* better naming

* make alias renaming atomic

* fmt

* use correct alias and docs

* code review: cleaner error conversion
2022-03-23 14:21:04 +01:00
Gabriel Velo
f69a7b740f json as payload (#306)
add json as payload
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-03-21 07:09:10 -03:00
Andrey Vasnetsov
20c1e0f20d upd naming in api (#361) 2022-03-03 13:27:51 +01:00
Andrey Vasnetsov
c3cfc93574 fix PayloadSelector enum for better openapi compatibility (#358) 2022-03-02 15:01:27 +01:00
Andrey Vasnetsov
bdc3194b13 allow to return vectors and payload with recommendation request #353 (#357)
* allow to return vectors and payload with recommendation request #353

* fmt

* unify `with_vector` comment line

* upd openapi
2022-03-02 10:42:58 +01:00
Andrey Vasnetsov
0b9463a674 reproduce with integration test and fix #309
* reproduce with integration test

* create new update channel each time we spin up a new update worker
2022-02-15 10:21:46 +01:00
Andrey Vasnetsov
f5feff8080 Validated integration tests - #232
* wip: re-implement http tests using openapi validation library

* collection delete api

* payload operations test

* payload delete operations test

* payload index creation and removing test

* uuid operations test

* schema consistency test

* add tests into pipeline

* chmod +x

* faster local runs with docker cache

* upd instruction
2022-02-11 16:43:47 +01:00