Commit Graph

358 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
Tim Visée
b22e177584 Report CPU endianness in telemetry output (#5180)
* Report CPU endianness in telemetry output

* Make endianness optional, don't report if anonymizing telemetry

* Update OpenAPI definition

* Switch back to single compile time endianness check

* Update OpenAPI specification

* Remove cpu-endian dependency

* De-anonymize CPU endianness

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-10-08 14:50:40 +02:00
Andrey Vasnetsov
68179bf697 make operationId consistent with grpc (#5201) 2024-10-07 22:02:22 +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
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
Andrey Vasnetsov
a2fefb48ed make resharding_operations optional, so OpenAPI is properly generated (#5060)
* make resharding_operations optional, so OpenAPI is properly generated

* Return None early

---------

Co-authored-by: timvisee <tim@visee.me>
2024-09-11 20:12:16 +02:00
Kumar Shivendu
490688053b Track number of points optimized and expose in telemetry (#5000)
* Track number of points optimized and expose in telemetry

* refactor

* openapi specs

* remove dbg

* Return num points optimized from optimize() func

* fmt

* fix

* fix type in tests

* Store total points indexed on shard level instead of optimization level

* fmt

* fix test

* trigger ci

* fix openapi schema

* review fixes

* fmt

* improvements and fix test

* review fixes

* use const for indexing optimizer name

* fmt

* return segment id from optimize() func

* review fixes

* fix

* fix

* fik

* minor var name improvement

* Use Option<usize> to return segment id

* Use segment ID type rather than ambiguous usize

* fix test

* avoid intermediate check

* review fixes

* Rename total_indexed_points to total_optimized_points

* Update openapi schema

* optimize() should return number of points in new segment instead of segment id

* add else condition

* take read lock

* fmt

* remove flaky assert

* Count points on new segment without locking

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-10 16:52:38 +05:30
Tim Visée
070f152877 Remove max_segment_number from quick start and OpenAPI definition (#5058) 2024-09-10 11:35:53 +02:00
Andrey Vasnetsov
bc0449de48 custom key to hide kwt dashboard (#5056) 2024-09-10 00:26:23 +02:00
Tim Visée
0ee5930f23 Expose cluster metadata in telemetry (#5019)
* Expose cluster telemetry in metadata

* Only expose metadata in telemetry for details level 1 and up

* Update OpenAPI specification

* move metadata into cluster telemetry

* regen openapi

* use Option instead of raw hashmap

---------

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

* improve openapi description
2024-09-06 08:24:46 +02:00
Kumar Shivendu
ed4f209782 Introduce grey collection status and expose shard status in telemetry (#4940)
* Expose shard status in telemetry API

* fmt

* Drop segment lock before using async fetching shard status

* Use Self in From implementation for ShardStatus to CollectionStatus mapping

* Improve comments

* Remove redundant clone

* Update openapi specs

* Isolate function for shard status

* Fix compiler error

* Avoid adding dedicated function for shard status

* review fixes

* define missing var

* lint err

* comment

* comment

* refactor

* improve comments

* Improve comments

* fix lint and update openapi specs

* improve comment
2024-09-05 13:08:39 +05:30
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
Luis Cossío
07be0a1aed Facets: add consistency param to openapi (#4969)
* add consistency param to openapi

* interpret uuid map index as facet index too
2024-08-28 09:18:02 -04: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
Tim Visée
b19c715ce8 Expose resharding operations for collection in telemetry (#4938)
* Expose resharding operations for collection in telemetry

* Update OpenAPI spec
2024-08-27 14:45:52 +02:00
Andrey Vasnetsov
96b9665d73 include peers list into telemetry (#4947) 2024-08-26 11:14:35 +02:00
Andrey Vasnetsov
1d0a3303d3 Data structures for inference (#4936)
* add document to VectorStruct

* fmt

* add document to BatchVectorStruct

* add document to VectorInput

* add document to Vector

* upd openapi
2024-08-22 16:38:55 +02:00
Luis Cossío
99f6d99fba Exact facet mode (#4878) 2024-08-19 23:21:17 -04:00
Luis Cossío
045fb7038c 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-19 16:03:26 -04:00
Andrey Vasnetsov
6e0086b6c2 make range and lookup params optional (#4905) 2024-08-19 10:52:27 +02:00
Arnaud Gourlay
caeb262e86 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-19 00:21:55 +02:00
Arnaud Gourlay
a9978c6999 Add missing timeout query params in openapi specs (#4850)
* Add missing timeout query params in openapi specs

* get_points as well
2024-08-08 14:31:49 +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
Andrey Vasnetsov
e77b6332dd Use mmap lock as default vector storage (#4828)
* add force_ram parameter to chuncked mmap vector storage

* enable mlocked mmap vector storage on unix by default

* regen openapi

* add mlock on creation of chunck

* minor unrelated renaming

* rollback changes in LockedChunkedMmap

* fmt

* make AppendableMmapDenseVectorStorage generic of storage type

* make AppendableMmapMultiDenseVectorStorage generic of storage type

* implement initialization of InRamChunkedMmap

* implement MultiDenseAppendableInRam and variations

* enable InRamChunkedMmap for multivectors

* use same CHUNK_SIZE for mmap and regular chuncked vectors

* enable InRamChunkedMmap by default

* fix tests

* rollback usage of InRamChunkedMmap by default

* review changes

* add assertion on chunk_capacity [skip-ci]
2024-08-07 16:34:58 +02: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
Tim Visée
7c66c5c541 Implement resharding down (#4697)
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-07-29 13:38:09 +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
Arnaud Gourlay
bd577c85d4 Fix Clippy 1.80 (#4752)
* Fix Clippy 1.80

* sync openapi spec

* add `check-cfg` setting to `workspace.lints.rust`

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-07-26 02:42:17 +00:00
Natanael Mojica
112df0ae18 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-07-24 08:39:24 +02:00
Kartik Gupta
3830762e5c 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-07-24 08:12:11 +05:30
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
Kartik Gupta
043dcf4916 Fix examples for scored point (#4659)
* Revert "Merge pull request #4560"

This reverts commit 5b0536df39.

* point id examples

* payload example

* VectorStruct example

* fmt

* ShardKey example

* OrderValue example

* fix

* example for SeqNumberType, ScoreType
2024-07-12 12:55:35 +02:00
Andrey Vasnetsov
a40c6fbef2 remove schemars examples from the enum (#4647) 2024-07-10 12:46:20 +02:00
George
6db27b7d34 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 10:15:51 +02:00
Arnaud Gourlay
bb9f9f8e94 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 08:26:57 +02:00
Andrey Vasnetsov
fc3ffc2c2d Merge pull request #4560
* schemars example for vectors in scored point

* schemars example for payload in scored point

* Using json! in schemars example for payload in scored point

* fix

* schemars example for shard_key in scored point

* schemars example for order_by in scored point

* schemars example for id, version, score in scored point

* schemars example for id, payload, vector, shard_key, order_value  in …

* point id examples

* remove id_example in schema.rs

* schemars example for vector, named_sparse_vector, named_vector

* schemars example for order_by

* schemars example for OrderByInterface

* schemars example for Fusion

* schemars example for MultiDenseVector,DenseVector in VectorInput

* schemars example for QueryRequest

* schemars example for QueryRequestBatch

* schemars example for QueryResponse

* schemars example for FusionQuery, OrderByQuery, ContextQuery, Discove…

* example for WithLookup, ContextPair, ContextInput, DiscoverInput, Rec…

* fix
2024-07-09 14:42:43 +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
generall
371471eeac fix openapi generation for Fusion 2024-06-24 22:38:32 +02:00
xzfc
b9c0bd0f7d Drop SparseVectorIndexDatatype in favor of VectorStorageDatatype (#4541)
* Drop SparseVectorIndexDatatype in favour of VectorStorageDatatype

* Split Datatype doc for VectorParams and SparseIndexParams
2024-06-24 19:27:34 +02:00
Arnaud Gourlay
7c4809e1d3 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-24 16:56:36 +02:00
xzfc
dd3102baeb U8 quantization for sparse vector index (#4514)
* U8 quantization for sparse index

* Spelling
2024-06-24 14:12:29 +00: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