Commit Graph

220 Commits

Author SHA1 Message Date
Jojii
cc807cbfbc Add hardware measurements in API (#5306)
* add HwMeasurementAcc and API helpers+types

* add config to API to toggle hardware reporting in API responses

* add Default impl for HwMeasurementAcc

* comments

* review remarks

* include usage into API schema

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:19:25 +01:00
Kartik Gupta
2f5e7d2eb0 Remapping tags to api docs (#5104)
* Remapping tags to

* Declare new tags, v1.12 remapping

* Declare Indexes, Aliases

---------

Co-authored-by: Anush <anushshetty90@gmail.com>
2024-11-08 11:15:37 +01:00
Andrey Vasnetsov
8a66b38368 make operationId consistent with grpc (#5201) 2024-10-08 13:36:20 +02:00
Tim Visée
4f7b675fe8 Remove max_segment_number from quick start and OpenAPI definition (#5058) 2024-09-17 15:27:53 +02:00
Arnaud Gourlay
0de10604fb Distance matrix docs improvements (#5023)
* docs improvements

* improve openapi description
2024-09-17 15:26:19 +02:00
Luis Cossío
f7de6c9017 Facets: add consistency param to openapi (#4969)
* add consistency param to openapi

* interpret uuid map index as facet index too
2024-08-29 15:24:05 +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
c2dca53e81 Add missing timeout query params in openapi specs (#4850)
* Add missing timeout query params in openapi specs

* get_points as well
2024-08-09 18:19:47 +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
Kartik Gupta
c6b24b6425 schemars example for CollectionsResponse, ScrollResult, SnapshotDescription, AliasDescription (#4714)
* example for CollectionsResponse

* points_example for ScrollResult

* example for SnapshotDescription

* fix

* example for AliasDescription

* fix: Style nit: add newline

* fix time and id

* fix order_value

* upd openapi

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-09 18:11:31 +02:00
George
85e8b1e249 fix: fix root response structure (#4643)
* fix: fix root response structure

* Update root endpoint response in OpenAPI template file

---------

Co-authored-by: timvisee <tim@visee.me>
2024-07-10 14:19:16 +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
Luis Cossío
70c7c4c847 Add layer of response structure specific to query (#4498) 2024-06-21 23:41:47 +02:00
Luis Cossío
ef23ab1d08 universal-query: Expose batch query in REST (#4497)
Exposes the ability to query in batch
2024-06-21 23:41:31 +02:00
Luis Cossío
f26a10afdc universal-query: Expose REST endpoint (#4380)
Exposes `POST collections/{collection_name}/points/query` for single queries
2024-06-11 13:16:11 +02:00
Luis Cossío
bc9b55d128 Issues API: Add clear_issues REST endpoint (#4125)
* add clear_issues rest endpoint

* review fixes

* update openapi

* fix number of apis checker
2024-05-02 19:16:51 +02:00
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