Commit Graph

164 Commits

Author SHA1 Message Date
Andrey Vasnetsov
e0d507dac7 Inference interface in REST and gRPC (#5165)
* include document & image objects into grpc API

* introduce image and object to rest api

* minor refactoring

* rename Vector -> VectorInternal

* decompose vector data structures

* add schema

* fmt

* grpc docs

* fix conversion

* fix clippy

* fix another conversion

* rename VectorInput -> VectorInputInternal

* replace grpc TryFrom with async functions

* fmt

* replace rest TryFrom with async functions

* add image and object into query rest

* separate inference related conversions

* move json-related conversions into a separate file

* move vector-related transformations into a separate file

* move more vector related-conversions into dedicated module
2024-10-09 10:15:46 +02:00
Ivan Pleshkov
080352cc56 mmap geo index api (#5163)
* define mmap geo index

fix compilation

deleted flags

load new mmap

geo index tests

fix tests

fix build after rebase

add files list

* refactor get_stored_sub_regions output type

* review remanings

* mmap geo index api

* fix after rebase
2024-10-07 14:35:17 +02:00
Luis Cossío
045779233a Facets: Support for bool payload (#5100)
* enable faceting with boolean index

* test and fix

* also test uuid
2024-10-01 09:17:50 -03:00
Jojii
8980483416 [Strict mode] Merge StrictMode config types (#5137)
* merge StrictModeConfig and StrictModeConfigDiff into one type

* review remarks
2024-09-26 12:36:39 +02:00
Jojii
791d064bde [Strict mode] default config (#5037)
* add default config for strict mode

* add default values as example to config/config.yaml

* improve implementation

* update grpc docs
2024-09-25 14:22:36 +02:00
Luis Cossío
025f4e3066 Expose on_disk text index (#5074)
* map index: fix reachable code marked as unreachable

* plumber work to get mmap text index to interfaces

* test: add fixture for mmap text index, always create mmap segment

* various fixes

- ensure dir is created for mmap
- implement is_on_disk() for text index
- invert deleted condition for filter in mmap inverted index

* update grpc docs and openapi

* implement return of files

* review nit

* fix after rebase

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-16 21:27:30 +02:00
Arnaud Gourlay
ee6e760b1c Distance matrix docs improvements (#5023)
* docs improvements

* improve openapi description
2024-09-06 08:24:46 +02:00
Arnaud Gourlay
4f1ccbb031 gRPC API for Distance Matrix (#5011)
* gRPC API for Distance Matrix

* generate API docs

* apply correct limit to sample

* add JWT tests

* pluralitiy

* fix COO naming

* drops COO as it trips codespell and is redundant

* clarify docs
2024-09-04 20:25:00 +02:00
Jojii
e9bad464ff [Strict-Mode] Basic implementation (#4887)
* add CollectionRequestVerification

* add to api

* rebase

* improve implementation

* implement strict mode for SearchRequest+Batch

* improve code + fix Clippy

* improve error handling

* restructure StrictModeVerification trait

* generate docs

* check `enabled` option

* review remarks

* rename StrictModeConfigDiff in grpc

* use missing payload detection from issue api

* performance improvement

* decouple extractor from issues (#4945)

* some review remarks

* don't default to empty functions in StrictModeVerification trait

* update openapi

* filter_limit => query_limit

* replace discovery_max_context_size and recommend_max_examples with max_input_examples

* review remarks

* review fix: include possible index types into error message

* review remarks

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-29 10:49:23 +02:00
Luis Cossío
b49e416382 Integer and UUID facets (#4946)
* move FacetIndex into facet_index.rs

* add support for integer facets

* add support for uuid facets

* use separate internal structure

* rename FacetValue::Keyword into FacetValue::String in REST

* fix after rebase
2024-08-27 11:30:57 -04:00
Luis Cossío
b92908f602 Add grpc endpoint for Facet (#4933)
* add grpc endpoint

* gen grpc docs
2024-08-22 14:27:25 +02:00
Andrey Vasnetsov
6e0086b6c2 make range and lookup params optional (#4905) 2024-08-19 10:52:27 +02:00
Andrey Vasnetsov
f9272ea3af docs: Use // for proto comments (#4852)
* docs: Use // for proto comments

* docs: Update gRPC

* chore: regen

---------

Co-authored-by: Anush <anushshetty90@gmail.com>
2024-08-08 19:38:56 +02:00
Jojii
2cb03610d8 On-disk Uuid hybrid-index (#4825)
* Migrate uuid index to mmap

* add uuid numeric index

* select correct index + tenants

* Only serialize if necessary

* select correct index

* reset Cargo.toml

* review: use only map index for uuid for now

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-07 19:45:42 +02:00
Arnaud Gourlay
28c8639fa3 Add and fix missing timeout in the retrieve APIs (#4842)
* Add and fix missing timeout in the retrieve APIs

* no need for extra timeout handling as single ops are doing it

* don't surface timeout too high in shard transfer infra

* add todos for future work

* update timeout after first query
2024-08-06 18:59:23 +02:00
Luis Cossío
5a8c79e05e Facets in internal service (#4790)
* add `facet` to shard trait

* Add internal service

* gen grpc docs
2024-08-01 16:03:40 -04:00
Jojii
5602b618ce Rename tenant to principal for float,int,datetime (#4789)
* Rename tenant to principal for float,int,datetime

* Apply review proposal
2024-07-31 17:09:52 +02:00
Jojii
7c37213e95 fix tenants not getting applied from API (#4763) 2024-07-29 15:36:33 +02:00
Luis Cossío
3018d924da Switch to camelcase in Sample proto enum (#4758)
* Switch to camelcase

* grpc docs
2024-07-26 21:20:51 +02:00
Jojii
17462ef1a7 UUID payload index (#4738)
* add UuidIndex

* fix clippy

* rebase to dev

* update api docs

* don't use wrapper type for Uuid index

* rebase to `dev`

* remove existence checking

* rename UuidPayloadKeyType => UuidIntType

* apply review changes

* rebase to dev

* post-rebase fixes

* Improve estimation

* Improve naming

* Apply suggestions from code review

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

* use u128 in histogram and improve uuid sorting

* Also allow defragmentation for completely random Uuids

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-07-26 16:59:34 +02:00
xzfc
9e6a83e60a Add {Integer,Float,Datetime}IndexParams::on_disk to the API (#4755)
* Add {Keyword,Integer,Float,Datetime}IndexParams::on_disk to the API

* Add PayloadFieldSchema::is_on_disk()
2024-07-26 10:12:35 +00:00
Luis Cossío
6fd0bf7643 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-07-22 16:13:00 -04:00
Arnaud Gourlay
eef7e37e33 universal-search: Query group API should support lookup_from (#4706)
* universal-search: Query group API should support lookup_from

* sync docs
2024-07-19 15:45:19 +02:00
Jojii
68373fb600 Basic defragmentation (#4610)
* sorting

* migrate tests and move logic into SegmentBuilder

* add test and improve implementation

* improve code

* review

* code review improvements

* add index building to test

* Do not clone ranges

* Resolve clippy warnings due to recent PR on dev

* review suggestions

* Defragmentation in api (#4684)

* add tenant config to api

* deduplicate used defragmentation keys

* rename is_tenant to is_primary

* use all values to defrag key

* rename is_primary -> is_tenant

* update schema

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2024-07-18 11:43:56 +02:00
Luis Cossío
27e28cd393 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-07-12 08:11:59 -04:00
Arnaud Gourlay
85b0c5ba8f universal-query: gRPC group API (#4656)
* universal-query: gRPC group API

* fix jwt test

* resolve default values for CollectionQueryGroupsRequest
2024-07-11 20:13:39 +02:00
xzfc
7b8ac92208 Extend PayloadSchemaParams to every PayloadSchemaType (#4613)
* Move IntegerIndexType and TextIndexType into a common file

* Formatting

* Extend PayloadSchemaParams to every PayloadSchemaType
2024-07-05 12:09:31 +00:00
Jojii
85f39f1e16 Add resharding status to API (#4319)
* Add resharding status to API

* Report human readable resharding status in cluster info

* Fix delete stage not showing shard IDs

* Update OpenAPI spec

* Temporarily hide resharding operations in cluster info if empty

We'll enable it again to always be included when releasing resharding

* Remove resharding details from cluster info in gRPC until release

---------

Co-authored-by: timvisee <tim@visee.me>
2024-07-02 16:55:14 +02:00
Tim Visée
1474f4844f Fix two documentation mistakes in our gRPC definitions (#4567) 2024-06-26 14:27:43 +02:00
Luis Cossío
46b9ea44ec 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-24 14:25:50 +02:00
Andrey Vasnetsov
d4807dcc8b Api consistency update (#4533)
* rename search_params -> params

* rename multivector_config + generate schema

* upd tests
2024-06-23 23:56:42 +02:00
Arnaud Gourlay
1d6f3549aa universal-query: gRPC batch API (#4513)
* universal-query: gRPC batch API

* regen gRPC docs

* enable jwt access test
2024-06-20 14:10:27 +02:00
Arnaud Gourlay
d4b8e482ff universal-query: gRPC query API (#4495)
* universal-query: gRPC query API

* misc fixes

* more review

* add custom validation on QueryPoints.limit

* fix jwt_access test for gRPC query
2024-06-18 21:14:30 +02:00
Tim Visée
3255719e27 Properly integrate replica set state switching in resharding transfers (#4480)
* Add serde/validate attributes to resharding operations, matching others

* Fix broken comment

* Add debug message for resharding driver entering stages

* Fix shard transfer start setting state of wrong replica for resharding

* Remove obsolete clones

* Add target shard ID to shard key, add relevant gRPC types

* Move target shard ID below source shard ID field

* Rename collection_name to collection_id

* Reformat

* Transferring point batches must merge points in case of resharding

* In resharding state, sync list of peers on start

* Add logic for setting replica set state through consensus dispatcher

* Properly start resharding transfer

* Properly finish resharding transfers, set shard state correctly

* Fix shard transfer initialisation with different target shard

* Fix shard state handling with resharding on all nodes on transfer start

* Don't reset locally disabled state if only existing shard is resharding

* Add important TODOs

* Update OpenAPI and gRPC specification

* Elaborate on some logic in code with comments

* Use user configured shard transfer method for replication

* Add debug assert, on transfer start we should not replace existing shard

* On transfer start, be aware of different sender/receiver local states

This fixes transfers where we might not have a replica on all nodes

* Fix shard transfer not setting cutoff point on target shard

* While resharding, migrate shards in numerical order

* On shard transfer initialisation, ensure transfer targets given shard
2024-06-18 17:51:13 +02:00
xzfc
53e883ea48 Add datatype option for sparse vector index (#4454)
* Add SparseVectorIndexDatatype

* Update tests

* Review fixes

* review

* gen openAPI

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-06-18 13:32:06 +00:00
Arnaud Gourlay
1cafdacc9e universal-query: add lookups to query API definition (#4479)
* universal-query: add with_lookup to query API definition

* fix consistency doc check

* lookup_from and not lookup_with

* clean import

* improve doc for lookup location wrt using

* Suggestions for descriptions

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-06-18 07:54:59 +02:00
Luis Cossío
8dc1eb235b universal-query: some interface renaming/edits (#4406)
in grpc:
- restructure `ContextInput`, so that it becomes easy to handle both pairs and positive/negative lists in the future

in rest: 
- restructure context queries so that they don't repeat the label in order to be used . E.g. turn `{ query: { context: { context: [ ... ] } } }` into `{ query: { context: [ ... ] } }` 
- fixes fusion so that `{query: { fusion: "rrf" } }` actually works

both:
- renames `RecommendInput` positives and negatives to singular (same as in reco api)
2024-06-10 18:47:40 -04:00
Luis Cossío
c8e82e75a8 universal-query: Converge API types into CollectionQueryRequest (#4304)
* rest -> collection

* grpc -> collection

* fix rebase

* use constants for defaults
2024-05-27 13:28:08 -04:00
Luis Cossío
b14d0b2463 universal-query: user-facing gRPC and REST request types (#4303)
* add grpc `QueryPoints`

* add rest types

* move to REST types to `api::rest::schema`, decouple `OrderByInterface` and `RecommendStrategy`

* openapi changes

* add score_threshold param

* decouple `ShardKeySelector`, add shard key param

* remove commented-out code

* new codespell
2024-05-24 08:23:12 -04:00
Luis Cossío
2a82ef41a0 universal-query: Introduce order_value field in ScoredPoint (#4291)
* - Fix ordering in group-by for custom scoring
- Rename `OrderingValue` -> `OrderedValue`
- Introduce `order_value` field in `ScoredPoint`

* modify `Ord` implementation

* rename to `OrderValue`

* `has_custom_scoring` -> `is_distance_scored`

* regen apis

* flip bools in `is_distance_scored`
2024-05-22 09:56:31 -04:00
Luis Cossío
bfa72bb6d8 universal-query: Add query() to ShardOperation trait (#4210)
* add `query` to shard trait

* add missing conversions for query

* update grpc docs

* Query response has intermediate results

* add ShardQueryResponse description

* move pub use to the top, keep only one way of reaching reexports
2024-05-15 09:36:46 -04:00
Ivan Pleshkov
e80844969f Float16 integration and API (#4234)
* f16 integration

tests

api

fix test

are you happy clippy

* fix build
2024-05-15 10:36:55 +02:00
Luis Cossío
4132d9a226 universal-query: Introduce new RawVector and VectorInput messages (#4209)
* Introduce `RawVector` and `VectorInput` messages

* gen grpc docs

* remove extra `optional`

* gen grpc docs
2024-05-14 11:40:11 -04:00
Roman Titov
dae311e5e8 Add basic resharding types (#4216) 2024-05-13 13:31:03 +02:00
Jojii
2bbf491204 make grpc service type enums unique for UpdateCollectionClusterSetupRequest and PointsUpdateOperation (#4205)
* make grpc service type enums unique
2024-05-09 13:41:06 +02:00
Arnaud Gourlay
b602cb7daa gRPC API multivector for write and retrieve (#4179)
* gRPC API multivector for write and retrieve

* improve naming

* validate multiv + sparse

* code review

* regen gRPC docs

* remove incorrect validation
2024-05-08 19:28:47 +02:00
Andrey Vasnetsov
c173a9f5e5 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-04-29 14:54:14 +02:00
Andrey Vasnetsov
44f2744d74 Byte storage api support (#4065)
* wip: include datatype in vector params API

* generate api schemas

* propagate datatype to segment creation

* fix review

* fmt
2024-04-18 15:22:28 +02:00
Tim Visée
8560f15416 Add grey collection status (#3962)
* Add grey color for collection info status

* Restructure locks in local shard info method

* Set collection status to grey if we have pending optimizations

* Update OpenAPI specification and gRPC documentation

* Set optimizer status instead of color for compatibility reasons

* Only set and check for grey status if there are no other statuses
2024-04-04 10:04:02 +02:00
Ricardo Pallas
265bfa253c Removes method from abort shard transfer operation (#3803)
* Removes method from abort shard transfer operation

* Updates consensus test message assertion

* updates validation message
2024-03-26 14:27:33 +01:00