Commit Graph

203 Commits

Author SHA1 Message Date
Luis Cossío
8a986ea4fd Issues API: Enable GET /issues endpoint (#4118)
* enable `GET /issues` endpoint

* add access test
2024-05-02 19:15:35 +02:00
Ivan Pleshkov
17982377b0 remove checksum path parameter for snapshot recovery in openapi (#3758) 2024-03-05 17:16:38 +01:00
Luis Cossío
e153787662 Chore: Remove issues API from openapi spec (#3735)
* remove issues api from openapi spec

* update number of expected apis
2024-03-05 17:16:13 +01:00
Luis Cossío
049795ac0a Issues API: Interface: get issues (#3502)
* add `/issues` endpoint

* generate openapi spec

* fmt

* fix read only patterns test

* list under beta tag, update tags descriptions.
2024-03-05 17:08:20 +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
ding-young
112b5d66f3 Support Min should clause (#3331) (#3466)
* Add min_should field in Filter struct

* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test
* docs, cardinality estimation, grpc not implemented yet

* Add min_should field in Filter struct

* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test

* Impl min_should clause in REST API

* perform cardinality estimation by estimating cardinalities of intersection and combining as union
* add openapi spec with docs update
* add integration test

* Impl min_should clause in gRPC

* Cargo fmt & clippy

* Fix minor comments

* add equivalence test between min_should and must

* shortcut at min_count matches

* use `Filter::new_*` whenever possible

* Add missing min_should field

* Fix gRPC field ordering & remove deny_unknown_fields

* Empty commit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-03-05 17:04:51 +01:00
Luis Cossío
fb46ec8af1 Order-by: support datetimes (#3540)
* support \`start_from\`: DateTime

* add order by datetime test

* generate openapi models and grpc docs

* fixup after rebase

* allow string representation of datetime in grpc

* add TODO

* fix `.start_from()`

* use custom deserialization on datetime
2024-03-05 17:04:26 +01:00
Luis Cossío
e4044ea738 Order-by: use pre-filtering for high-constraining filters (#3562)
* use pre-filtering for high-constraining filters

* fix repeated points
2024-03-05 17:04:18 +01:00
Zihong Lin
5c08c27233 Extend datetime formats in REST API (#3529) (#3549)
* Extend datetime formats in REST API (#3529)

* Fix linter problem

* Support indexing and condition checking and optimize tests

* Update lib/segment/src/types.rs

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

* Update lib/segment/src/types.rs

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

* Update lib/segment/src/types.rs

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

* Add some more tests for wrong or unsupported datetime format

* Reformat

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: timvisee <tim@visee.me>
2024-03-05 17:04:04 +01:00
Arnaud Gourlay
f8a43b85d6 Bump OpenAPI test dependencies (#3545) 2024-03-05 16:59:58 +01:00
Luis Cossío
9c93020bde Datetime index: Introduce RangeInterface (#3516)
* merge range and datetime range into one interface

* remove separate datetime_range from FieldCondition

* review fixes, remove code duplication. Thanks @xzfc

* update openapi test
2024-03-05 16:57:54 +01:00
Luis Cossío
320b7f2621 order_by in scroll (#3493)
* first PR implementation (#2865)

- fetch offset id
- restructure tests
- only let order_by with numeric
- introduce order_by interface

cargo fmt

update openapi

calculate range to fetch using offset + limit, do some cleanup

enable index validation, fix test

Fix pagination

add e2e tests

make test a little more strict

select numeric index on read_ordered_filtered

add filtering test 🫨

fix filtering on order-by

fix pip requirements

add grpc interface, make read_ordered_filtered fallible

fmt

small optimization of `with_payload` and `with_vector`

refactor common logic of point_ops and local_shard_operations

Make filtering test harder and fix limit for worst case

update openapi

small clarity refactor

avoid extra allocation when sorting with offset

stream from numeric index btree instead of calculating range

use payload to store order-by value, instead of modifying Record interface

various fixes:
- fix ordering at collection level, when merging shard results
- fix offset at segment level, to take into account also value offset
- make rust tests pass

remove unused histogram changes

fix error messages and make has_range_index exhaustive

remove unused From impl

Move OrderBy and Direction to segment::data_types::order_by

Refactor normal scroll_by in local_shard_operations.rs

More cleanup + rename OrderableRead to StreamWithValue

empty commit

optimization for merging results from shards and segments

fix case of multi-valued fields

fix IntegerIndexParams name after rebase

precompute offset key

use extracted `read_by_id_stream`

Expose value_offset to user
- rename offset -> value_offset
- extract offset value fetching logic

* remove offset functionality when using order_by

* include order_by in ForwardProxyShard

* extra nits

* remove histogram changes

* more nits

* self review

* resolve conflicts after rebase, not enable order-by with datetime index schema

* make grpc start_from value extendable

* gen grpc docs

---------

Co-authored-by: kwkr <kawka.maciej.93@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-03-05 16:57:35 +01:00
Arnaud Gourlay
041e990bd1 Lint Python tests (#3504) 2024-03-05 16:57:17 +01:00
xzfc
2f76603ddf DateTime payload index (#3395)
* Datetime payload index

* Introduce IndexMapItem

* Drop FieldIndex::DatetimeIndex

* Rename OpenAPI struct names

* Switch to microseconds

* Validate and serialize grpc timestamps

* Add tests with different timezones

* minor review fixes

* Revert "Drop FieldIndex::DatetimeIndex"

This reverts commit d55f251afd.

* Revert "Introduce IndexMapItem"

This reverts commit c5255f6b1a.

* fix: back to microseconds after reverts

* extract range conversion from boxed checker fn

* add log to deps

* don't run macro doctest

* no_run -> ignore

* remove prost-types in favor of prost-wkt-types

* better assertion on test_payload_indexing.py

* propagate unparsable datetime

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-03-05 16:57:08 +01:00
Gabriel
3392407f6a API for checking collection exists (#3472)
* saving progress

* tests assertions are working

* fixed lint

* fixed typo, existance -> existence

* added timing on grpc

* added timing on grpc

* fixed double time
2024-03-05 16:55:27 +01:00
xzfc
a11c6f6a5b add optional checksum to snapshot recovery request (#3381)
* add optional checksum to snapshot recovery request

* Update openapi yaml files

* Add pytests for snapshots restoration
2024-03-05 16:52:38 +01:00
Shrinibas Mahanta
13b24c9516 fixes gRPC API return status code. (#3423)
* This changes the returning of StorageError::BadInput to StorageError::AlreadyExists.

* This adds AlreadyExists error type to StorageError enum

* This implements already_exists function to handle AlreadyExists StorageError.

* This adds error to status code for StorageError::AlreadyExists using tonic::Code::AlreadyExists

* This adds Error type for actix to handle AlreadyExists Storage error using Error::CONFLICT

* This adds using HttpResponse::Conflict for building HttpResp in case of StorageError

* This adds StatusCode and description for HttpError caused by StorageError

* fix integration test

* rename is_collection_exists -> collection_exists

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-03-05 16:52:04 +01:00
Tim Visée
41b7a55e16 Fix multiple vector updates on same point in batch not working (#3386)
* Fix merge of vector operations, don't drop earlier updates on same point

* Add unit test for vector struct merging

* Add integration test for fix, also covering bug report
2024-03-05 16:47:28 +01:00
Kumar Shivendu
0fe19cfb60 feat: Expose git commit id in the health check endpoint (#3346)
* feat: Expose git commit id in the health check endpoint

* fix: CI errors

* test: Add test for health check api

* feat: Add / endpoint to openapi schema

* Make git commit hash optional

* ci: Enable debugging setup-protoc action

* Install later protobuf compiler through GitHub Action

* Disable debug mode for setup-protoc job

* refactor: Use commit instead of commit_id

* fix: Use commit instead of commit_id gRPC docs

* test: Update ping API test

* refactor: Rename ping api to root api

---------

Co-authored-by: timvisee <tim@visee.me>
2024-03-05 16:46:04 +01:00
Andrey Vasnetsov
6632ba002c fix missing indexing values on set-payload operation (#3251)
* fix missing indexing values on set-payload operation

* Update function documentation, use conventional warning

* Don't deep match statements

* test: Update of payload on already indexed payload should work (#3253)

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Kumar Shivendu <kshivendu1@gmail.com>
2023-12-19 19:31:00 +00:00
Arnaud Gourlay
4bc6ef6011 Test large index for sparse vectors (#3226)
* sparse vectors with large indices support

* fix unit tests

* are you happy clippy

* review remarks; acc test for inverted index

* Test large index for sparse vectors

set unique name to the test collection

Revert "fix consensus tests"

This reverts commit 93afe59f6ba663d5a89bbf25e3418b873fd72b16.

fix rebase mistake

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2023-12-19 19:29:15 +00:00
George
1c0d132111 replace enum in status codes with str (#3174) 2023-12-06 22:16:24 +01:00
Roman Titov
cb46a73609 Extend /readyz with shards readiness check (#3053, #3084)
Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2023-12-06 17:20:29 +01:00
Arnaud Gourlay
9bfda58973 Test sparse vector configuration update (#3159)
* Test sparse vector configuration update

* clean ef_construct
2023-12-06 17:20:01 +01:00
Arnaud Gourlay
74793bd404 Integration test for sparse vector post processing (#3138) 2023-12-06 17:18:44 +01:00
Arnaud Gourlay
b54dd66d1e Sparse vectors sanity integration checks (#3126) 2023-12-06 17:18:19 +01:00
Kaan C. Fidan
8f19257f70 Manhattan distance (#3079)
* implemented Manhattan distance

* updated quantization dependency

* fixed negative distances and doc consistency

* fixed neon implementation

* updated quantization dependency

* updated quantization dependency

* removed redundant copy operation

* updated quantization dependency

* Change back to upstream quantization dependency

---------

Co-authored-by: timvisee <tim@visee.me>
2023-12-06 17:17:34 +01:00
Arnaud Gourlay
85c96cdd9a Integration tests sparse vector validation (#3122)
* Integration test for sparse vector validations

* cleanup

* clean again
2023-12-06 17:16:12 +01:00
Ivan Pleshkov
3fc1f96564 Sparse index segment and collection config (#2802)
* quantization storage as separate entity

sparse index try to extend segment types

fix build

fix async scorer

codespell

update openapi

update vector index

remove code duplications

more fixes

more fixes

fix build

fix deserialization test

remove transform_into

are you happy clippy

update openapi

update openapi

are you happy clippy

fix build

optional serialize

more defaults

update openapi

fix comments

generic transpose_map_into_named_vector

rename fields in tests

remove obsolete parts

only named sparse config

VectorStruct without unnamed sparse

NamedVectorStruct without unnamed sparse

remove obsolete test

update openapi

mmap index

revert preprocess function

are you happy fmt

update openapi

fix build

fix tests

are you happy fmt

fix for client generation

fix sparse segment creation

fix basic sparse test

fix conflicts

remove obsolete convertion

fix build

config diffs

update openapi

review remarks

update openapi

fix batch upsert

add failing test showing bad ids matching

fix sparse vector insertion

remove on_disk flag

update openapi

revert debug assert

simplify conversions

update openapi

remove on disk storage flag

update openapi

default for vector config

update openapi comment

remove diffs

update openapi

* enable consensus test

* add comment

* update openapi
2023-12-06 17:16:06 +01:00
Wesley
8b7211cb20 Read-Only API keys (#2979)
* Read-only API keys

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

Correct placement of OpenAPI security

Place regex dep with actix/tonic

* Read-only API keys

* Replace with pytests

* API Key tests run on the same job

* Drop allow dead-code

* Rename setting key

* Containerized tests

* No special config files

* DRY

* refactor: re-use can_write method

* refactor: replace static by constants

* refactor: get PID from `$!`

* refactor: use explicit brackets on boolean condition

* style: fix identation

* small fixes + account for new APIs

* specify security in openapi

* small fix + chmod for .sh testfile

* add best-efford check for api consistency

---------

Co-authored-by: Amr Hassan <amr.hassan@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-12-06 17:11:33 +01:00
Luis Cossío
3fd3ff215a refactor: turn offset into an option (#3082)
* refactor: make offset optional

* update openapi

* add simple test
2023-12-06 17:11:00 +01:00
Andrey Vasnetsov
1fcadcd0c3 Shard key create confirmation (#3027)
* create dedicated API for creating shards with explicit avait on the consensus

* fmt

* update api definitions
2023-12-06 17:04:39 +01:00
Andrey Vasnetsov
2810672598 Huge refactoring to make read requests aware of shard key selector (#3004)
* huge refactoring to make read requests avare of shard key selector

* fix integration test

* review fixes

* allow lookup_from specific shards
2023-12-06 17:02:20 +01:00
Luis Cossío
1184740dcd Improve discovery openapi and grpc comments (#2956)
* improve openapi descriptions

* update grpc docs

* replace em for en dashes with spaces
2023-12-06 16:58:22 +01:00
Luis Cossío
5ab190dad2 fix test_discover_same_target (#2962) 2023-12-06 16:58:16 +01:00
Luis Cossío
91eb3f36e2 Discovery API (#2861)
* create and connect discovery http and grpc interfaces

* add openapi tests

* fix bad rebase

* Add better descriptions

* remove numpy from openapi tests

* fix rebase artifact

* remove already addressed TODO

* add more tests

* 🤡🔫 (cfg batch handler)

* add timeout query param for discover requests

* More gRPC validation

* make fields pydantic_openapi_generator_v3 friendly

* `context_pairs` -> `context` with struct for pairs

* discovery api is only discovery or context,
move struct description to fields

---------

Co-authored-by: timvisee <tim@visee.me>
2023-12-06 16:57:14 +01:00
Luis Cossío
d8241a3fe5 Fix recommend best_score formula (#2904)
* fix recommend best score formula

* fix integration test

* review fixes

* rebase and fix conflicts

* correct proptest comment
2023-12-06 16:53:26 +01:00
Luis Cossío
87524275d4 Expose timeout query param for search requests (#2748)
* add timeout query param for search requests

* enable timeout for recommend requests

* Add query timeout for group by requests

* update openapi models

* Don't decrease timeout after recommend preprocessing

* Add openapi test

* code review

* add timeout to individual group by requests, non-decreasing

* handle timeout for discover

* Update timeout field tag in SearchBatchPoints
message
2023-12-06 16:52:49 +01:00
Andrey Vasnetsov
e686e71b9f fix: openapi/tests/requirements.txt to reduce vulnerabilities (#2882)
The following vulnerabilities are fixed by pinning transitive dependencies:
- https://snyk.io/vuln/SNYK-PYTHON-WERKZEUG-6035177

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-10-27 09:30:38 +02:00
dependabot[bot]
20cd26f377 Bump urllib3 from 1.26.17 to 1.26.18 in /openapi/tests (#2838)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.17 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.17...1.26.18)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 08:29:12 +02:00
Arnaud Gourlay
3d73125661 Allow JsonPath for PayloadSelector (#2756)
* Allow JsonPath for PayloadSelector

* code review

* mention Entry API in performance note

* pre-process exclude list to avoid incorrect side-effects

* remove support for array paths

* review refactoring

* add test for implicit/explicit array notation

* [skip ci] panic -> unreachable

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-10-06 12:45:04 +02:00
Arnaud Gourlay
921f00062c Make GeoPolygon interiors optional (#2766) 2023-10-06 12:44:50 +02:00
Zein Wen
3bc91780b0 Extend GeoPolygon to support interiors (#2315)
* Extend GeoPolygon to support interiors (#2315)

Per GeoJson, we should support polygon with exterior and interiors (holes on the surface) in Geo Filter by Polygon(#795). This commit extend current GeoPolygon filter to accept interiors. It includes:

1. changes to proto and internal GeoPolygon struct, and validation fn
2. add and refactor some tests
3. add integration test

* add gRPC geo_polygon validation

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2023-10-06 12:43:49 +02:00
Arnaud Gourlay
822a7c3f58 Validate empty filter condition (#2745)
* Validate empty filter condition

* Validate filter objects in other requests

* Propagate nested filter validation

* add gRPC validation

* make match exhaustive with explicit variants

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2023-10-06 12:43:41 +02:00
Luis Cossío
fd214c1d80 Allow vectors in recommend API (#2693)
* allow raw vectors in recommend

* add openapi test

* keep point id input separately forever in grpc

* minor fix

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-10-06 12:39:08 +02:00
Luis Cossío
275320d1e6 Expose new recommend scorer via recommend strategy (#2662) 2023-10-06 12:38:47 +02:00
Luis Cossío
3200b1f8af make unused import lint happy (#2667) 2023-10-06 12:36:02 +02:00
Josh Soref
a18573b265 Spelling (#2658)
* spelling: accumulating

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: and

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: back

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: batching

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: been

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: benchmark

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: collections

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: confusion

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: consensus

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: decrease

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: equal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: minimal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: oversampling

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: paths

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: points

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: prevent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: protobuf

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: proxied

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: randomness

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: recover

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-10-06 12:35:23 +02:00
dependabot[bot]
468f9b244d Bump urllib3 from 1.26.15 to 1.26.17 in /openapi/tests (#2758)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.15 to 1.26.17.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.15...1.26.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 09:43:57 +02:00