Commit Graph

49 Commits

Author SHA1 Message Date
tellet-q
dea45cb5ab Add tests on uuid payload index queries with filters (#4971)
* Add on_disk:True for uuid index schema check

* Add tests for uuid payload index

* Fix test

* Add test comparing filtered queries between keyword index and uuid index

* Remove order by case

* Clean up
2024-08-29 15:24:25 +02:00
Luis Cossío
ace8a90259 Facets in REST (#4848)
* rename to FacetRequestInternal

* add rest endpoint

* fix correctness by fetching the whole list of values

* fix mmap map index variant

Also removes test for sorted output, for now

* add ytt spec

* fix clippy

* use hashmap inside of local shard

* rename operation to `facet`, add access test

* whitelist endpoint

* change api

* make limit optional
2024-08-27 01:08:53 +02:00
Arnaud Gourlay
faab853b86 Search distance matrix REST API (#4884)
* Search distance matrix REST API

* apply Validator upgrade

* min sample size is 2 thanks Luis

* review: rethink pair view

* remove rows-based similarity matrix output

* fmt

* upd openapi

* we have only 70 apis now

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-27 01:06:50 +02:00
Arnaud Gourlay
29126883bc Update Validator 0.18 (#4894)
* Update Validator 0.18

* fix new test error message

* clearer geo error message

* fix error message

* fix unit tests

* Put spaces back

---------

Co-authored-by: timvisee <tim@visee.me>
2024-08-27 01:04:34 +02:00
xzfc
0951aa5982 Test payload schemas (#4822)
* test: don't parametrize test_payload_indexing.py with on_disk_vectors

* test: add test_payload_schemas()
2024-08-09 18:18:09 +02:00
xzfc
f225e5865a chore: move tests/openapi/openapi_integration/* → tests/openapi/* (#4820) 2024-08-09 18:17:44 +02:00
Natanael Mojica
330eae8529 Refactor: Convert app and cluster info metrics from counters to gauges #4696 (#4733)
* Refactor: Convert app and cluster info metrics from counters to gauges

- Change app_info, app_status_recovery_mode, and cluster_enabled metrics from COUNTER to GAUGE
- Update metric values to use boolean as f64 for consistency and clarity
- Improve metric type accuracy for better representation of state information

* fix: Update docs regarding metrics type

* openapi: Update app_info metric type

* metrics: Update test to check for the right metric type
2024-08-09 18:11:35 +02:00
Luis Cossío
f64432686e universal-query: Expose random sampling query (#4657)
* expose random sampling query

* fix random query rescoring

* only ignore offset when there are no prefetches

* fix offset and with_payload/with_vector

* gen grpc docs

* make tests less flaky

* gen openapi schema

* Remove suffixed spaces

---------

Co-authored-by: timvisee <tim@visee.me>
2024-08-09 18:10:37 +02:00
Arnaud Gourlay
6a672d3aec universal-search: Query group API should support lookup_from (#4706)
* universal-search: Query group API should support lookup_from

* sync docs
2024-08-09 18:09:51 +02:00
Luis Cossío
602935ee32 universal-query: Distribution-Based Score Fusion (#4614)
* refactor fusion into method

* expose distribution-based score fusion

* gen openapi and docs

* Better rest description

* add basic integration test
2024-08-09 18:06:59 +02:00
Arnaud Gourlay
f660ce9427 universal-query: Grouping REST API (#4616)
* universal-query: Grouping REST API

* add API docs

* bump API count

* add jwt validation test

* fix API

* better test

* stay on CoreSearchRequest where possible

* use existing scoring helper

* push broken test to illustrate issue

* track best score per point_id to enable sort on payload

* add example test for query discover with groups

* track ScoredPoint instead of PointId

* add default values for smoother ux
2024-07-10 14:19:11 +02:00
xzfc
7e3de3e7bf Switch to poetry (#4518)
* Use poetry for openapi tests

* Use poetry for consensus tests

* Use poetry for gen_storage_compat_data/populate_db.py

* Make consensus_tests scripts executable

* Use poetry for test-consensus-compose

* Cleanup

* Don't call poetry run in scripts
2024-07-10 14:18:15 +02:00
Luis Cossío
a4b4652520 universal-query: handle score threshold at collection level (#4630) 2024-07-10 14:18:08 +02:00
Luis Cossío
8a92761d6b universal-query: resolve offset at collection level only (#4611)
* resolve offset at collection level only

* update test

* remove offset field from `QueryScrollRequest` and `RescoreParams`
2024-07-10 14:16:53 +02:00
Arnaud Gourlay
47f16e275d universal-query: lookup_from implementation (#4508)
* universal-query: lookup_from implementation

* pushin test demonstrating broken equivalence

* more tests and fixes

* validate fusion not use with 'using' field

* cleanup collection info propagation

* do not clone the query in CollectionQueryResolveRequest

* cleanup

* address last code review
2024-06-28 16:40:50 +02:00
Arnaud Gourlay
d26d09bd76 Fix discovery API id exclusion and lookup (#4553)
* Fix discovery API id exclusion and lookup

* do not generate a filter if there are no ids to exclude
2024-06-28 16:40:36 +02:00
Ivan Pleshkov
60c72eaf7b Avg multivector (#4542)
* avg multivector

* integration test

* remove unwrap
2024-06-28 16:40:25 +02:00
Arnaud Gourlay
21bffea66c Fix id exclusion when recommending from a different collection (#4551)
* Fix id exclusion when recommanding from a different collection

* add line at eof
2024-06-25 13:34:49 +02:00
Arnaud Gourlay
cf85af00cb universal-query: Add validations to query input (#4536)
* universal-query: Add validations to query input

* update openapi spec

* use raw request to by-pass local validations

* add validation for order_by and factorize
2024-06-25 13:33:32 +02:00
Luis Cossío
2c651b1147 order_by: Begin migration to order_value in Record [v1.10] (#4526)
* begin migration to order_value

* gen openapi and grpc docs

* cargo clippy --fix

* fixup
2024-06-25 13:33:09 +02:00
Andrey Vasnetsov
eba2c6be61 Api consistency update (#4533)
* rename search_params -> params

* rename multivector_config + generate schema

* upd tests
2024-06-25 13:32:31 +02:00
Luis Cossío
70c7c4c847 Add layer of response structure specific to query (#4498) 2024-06-21 23:41:47 +02:00
Andrey Vasnetsov
49a9d05e7c Fix multivector for unnamed vectors (#4482)
* minor conversion improvement

* use NamedVectors in update_vectors

* remove merge from VectorStruct

* rename Multi -> Named in vector struct

* add multi-dense vectors option into VectorStruct

* generate openapi

* rename VectorStruct -> VectorStructInternal

* add conversion for anonymous multivec in grpc

* renames for BatchVectorStruct

* implement multi-dense for batch

* allow multi-dense in batch upserts

* test and fixes
2024-06-21 23:41:12 +02:00
Luis Cossío
7189f98158 use get instead of indexing (#4496) 2024-06-21 23:40:13 +02:00
Luis Cossío
1c7044d46a Skip serializing null fields in Record and ScoredPoint (REST) (#4394)
* skip serializing null fields in Record and ScoredPoint

* update tests

* fix consensus tests
2024-06-21 23:40:00 +02:00
Arnaud Gourlay
0570ba667e universal-query: API testing with multi named vectors (#4463)
* universal-query: API testing with multi named vectors

* more filtering tests

* test rff with filter

* inner filter equivalence

* add more test cases
2024-06-21 23:35:07 +02:00
Andrey Vasnetsov
df3aa29654 Fix inplace updates for sparse index (#4375)
* include old vector into update function and clean posting lists accordingly

* add integration test

* fix counter

* also remove old vector if the insertion is empty

* clippy

* borrow once

* fix max_next_weight correcton on delete + test

* vector index responsible for updating vector storage

* review fixes

* add debug assert
2024-06-21 23:34:02 +02:00
Luis Cossío
ce398a345f universal-query: Basic integration tests (#4409)
Adds basic comparison to current existing endpoints
2024-06-11 13:17:34 +02:00
Arnaud Gourlay
0cae9979aa Bump Python Request 2.23 (#4281) 2024-05-26 12:39:52 +02:00
Arnaud Gourlay
88c8ad8523 Allow basic multivec search on legacy API (#4203)
* 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>
2024-05-26 12:31:08 +02:00
AMIR
5a6cd1c2aa Simplify REST API nesting (#3323) (#3414)
* Simplify REST api nesting (#3323)

* tiny clarity refactor for test

* simpler generated openapi

* fix tests

* wrap deserializer functions into a struct impl

* fix null case

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-05-26 12:30:14 +02:00
Luis Cossío
c0c55af1d4 setup for faster openapi snapshot tests (#4219) 2024-05-26 12:27:42 +02:00
Arnaud Gourlay
9d4acc0d81 Test Multivector storage mmap and uint8 (#4197) 2024-05-09 14:28:24 +02:00
Arnaud Gourlay
28a31bd5b0 Simplify MaxSim configuration (#4171)
* Simplify MaxSim configuration

* enable extension of multivectorconfig

* rename multi_vec_config to multivec_config
2024-05-09 14:26:03 +02:00
Arnaud Gourlay
f50adc272a REST API multivector for write and retrieve (#4117)
* REST API multivector for write and retrieve

* add test showing search is not supported

* use helper

* debug asserts

* better naming

* iterator style

* better naming

* add validation test for checking all inner vectors have the same size
2024-05-09 14:24:11 +02:00
dependabot[bot]
d865bdeec1 Bump werkzeug from 3.0.1 to 3.0.3 in /tests/openapi (#4189)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.1 to 3.0.3.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.1...3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 09:49:54 +02:00
Andrey Vasnetsov
896cfe109d Sparse idf dot (#4126)
* 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>
2024-05-02 19:16:26 +02:00
Andrey Vasnetsov
419877a7a7 remove usage of vectors_count (#4052)
* remove usage of vectors_count

* skip serialization if none

* add deprecated mention

* Add colon after deprecation note

---------

Co-authored-by: timvisee <tim@visee.me>
2024-04-22 10:34:21 +02:00
Tim Visée
f7ed7bcfb0 Bump idna to 3.7 (#4021) 2024-04-22 10:31:19 +02:00
Tim Visée
e367bd164e Extend shard snapshot security tests (#3867)
* Fix incorrect snapshot security test path

* Explicitly check if snapshot files exist

* Change shard snapshot invalid name error type to not found

That makes it consistent with behavior of our other snapshot APIs.

* Extend snapshot API security tests, also test collection and shard API
2024-03-19 13:32:20 +01:00
Tim Visée
3ab5172e9c Fix arbitrary path traversal vulnerability in full snapshot REST API (#3856)
* Improve function to get collection snapshot path

* Fix arbitrary path traversal in full snapshot path function

* Add integration test to assert arbitrary path traversal is blocked
2024-03-19 13:31:45 +01:00
xzfc
19e2fc7e28 Allow paths starting with numbers (#3788)
* Allow paths starting with numbers

* add test

* fix test

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-03-07 16:30:17 +01:00
xzfc
5c446c6d16 Fix batch_requests (#3745) 2024-03-05 17:16:28 +01:00
xzfc
e1241c7e0c Switch to JsonPathV2 (#3709) 2024-03-05 17:15:52 +01:00
Tim Visée
cdb5df8d87 Fix flaky invalid URI snapshot test (#3704)
* Give file system some time clean up temporary snapshot files

* Be more careful with test_snapshot_operations_non_wait test

* Remove sleep
2024-03-05 17:12:59 +01:00
xzfc
4e3903e4c5 Test payload index overwrite (#3655) 2024-03-05 17:10:09 +01:00
shylock
87b541bb41 Feat/set payload by key (#3548)
* 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>
2024-03-05 17:08:07 +01:00
Luis Cossío
b0fbf299ba Datetime parser: Parse decimals without timezone (#3622)
* fix default opeapi file path

* better capture of process id in integration-tests.sh

* add pycache to gitignore

* add extra case for order_by test

* parse dates without timezone but with decimals correctly

* update payload_indexing test

* add extra test for space-separated date
2024-03-05 17:07:51 +01:00
Kumar Shivendu
f514b29641 refactor: OpenAPI tests (#3606)
* test: Restructure OpenAPI tests

* fix: Remove cache dirs

* fix: Remove cache dirs from helpers

* fix: Path of openapi.json

* fix: Update path of openapi tests everywhere
2024-03-05 17:07:42 +01:00