Commit Graph

231 Commits

Author SHA1 Message Date
Tim Visée
a6164ccda8 Bump version to v1.5.1 (#2644) 2023-09-12 16:58:36 +02:00
Tim Visée
35755dab42 Bump version to 1.5.0 (#2597) 2023-09-06 11:33:39 +02:00
dependabot[bot]
b15d290a3a Bump tonic-build from 0.9.2 to 0.10.0 (#2585)
* Bump tonic-build from 0.9.2 to 0.10.0

Bumps [tonic-build](https://github.com/hyperium/tonic) from 0.9.2 to 0.10.0.
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/commits)

---
updated-dependencies:
- dependency-name: tonic-build
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update generated gRPC code

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2023-09-05 14:31:28 +02:00
dependabot[bot]
d862bac4c1 Bump schemars from 0.8.12 to 0.8.13 (#2582)
Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.12 to 0.8.13.
- [Release notes](https://github.com/GREsau/schemars/releases)
- [Changelog](https://github.com/GREsau/schemars/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GREsau/schemars/compare/v0.8.12...v0.8.13)

---
updated-dependencies:
- dependency-name: schemars
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 14:31:12 +02:00
Tim Visée
617df07a58 Centralize common validation functions (#2548)
* Centralize generic range validation

* Centralize validate not empty

* Centralize collection name validation

* Add geo polygon validation in REST API and centralize validation

* Add tests for common validation functions

* Don't use reference in generic range validation function

* Other improvements
2023-09-04 16:44:44 +02:00
Tim Visée
b6aec0c179 Limit vector dimension to 65536 (#2544)
* Limit vector dimension to 65536

* Add integration test for new dimension limit
2023-09-04 16:42:42 +02:00
Roman Titov
097e729713 Shard snapshot API (#2410)
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-09-04 16:42:42 +02:00
Camden Cheek
6907271679 Add gRPC reflection server (#2483)
* add gRPC reflection server

* add basic integration tests

* only advertise public services

* appease linter
2023-09-04 16:42:42 +02:00
Arnaud Gourlay
5a021c51d5 Fix lints for Clippy 1.72 (#2476) 2023-09-04 16:42:42 +02:00
Ivan Pleshkov
f1f9ec1609 binary quantization (#2470)
* binary quantization

* update quantization version

* fix quantizing bug

* are you happy fmt
2023-09-04 16:42:41 +02:00
dependabot[bot]
b0f53ecba0 Bump tokio from 1.31.0 to 1.32.0 (#2460)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.31.0 to 1.32.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.31.0...tokio-1.32.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 16:42:41 +02:00
Tim Visée
0c5f3f2535 Add internal gRPC call to request remote HTTP port (#2406)
* Add gRPC endpoint to request remote HTTP port

* Add basic gRPC test for fetching remote HTTP port

* Extract gRPC endpoint for fetching HTTP port into internal service

* Add basic internal gRPC test

* Other minor improvements
2023-09-04 16:42:41 +02:00
Tim Visée
6e1618cc62 Remove Google's protobuf types (#2454)
* Use built-in well known types from prost

* Remove Google's well known protobuf types
2023-09-04 16:42:39 +02:00
Di Zhao
ecaff1023d Add indexed_only to speed up search (#2431)
* add ignore_plain_index to speed up search

* remove unnecessary & for vectors_batch

* format

* add special handle for proxy segments where the wrapped segment is plain
indexed

* review refactoring

* rollback changes in google.protobuf.rs

---------

Co-authored-by: Di Zhao <diz@twitter.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-09-04 16:42:17 +02:00
Roman Titov
087dfa59d8 tracing improvements (#2187)
* Add optional `tracing` crate dependency to all `lib/*` sub-crates

* Add optional alternative "tracing-logger"...

...that works a bit better with logs produced by the `tracing` crate

* Make `tracing-logger` reuse `log_level` config parameter (and `QDRANT__LOG_LEVEL` env-var)...

...instead of default `RUST_LOG` env-var only

* Replace `env_logger` with `tracing` (#2381)

* Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

TODO:
- Implement slog drain that would *properly* convert slog records into tracing events
  (`slog-stdlog` is fine for now, though)

* fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

Fix `consensus` test

* fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

Forget to `unwrap` the result 🙈

* fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

`tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer`
automatically with default `tracing-subscriber` features enabled 💁‍♀️

* Update `DEVELOPMENT.md` documentation regarding `tracing`

* Update default log level for development to make it less noisy

---------

Co-authored-by: timvisee <tim@visee.me>

* Implement "intelligent" default log-level filtering

---------

Co-authored-by: timvisee <tim@visee.me>
2023-09-04 16:42:17 +02:00
Andrey Vasnetsov
47274b2e63 Query scorer refactoring (#2430)
* refactor query_scorer for simple raw_scorer impl

* fmt

* refactor query_scorer for simple raw_scorer impl

* refactor query_scorer for simple raw_scorer impl

* decouple scorer and storage, move storage into query scorer

* eliminate quantized raw scorer

* Update lib/api/src/grpc/google.protobuf.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2023-09-04 16:42:06 +02:00
dependabot[bot]
420966fc66 Bump tokio from 1.30.0 to 1.31.0 (#2440)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.30.0 to 1.31.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.30.0...tokio-1.31.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 16:25:11 +02:00
dependabot[bot]
0ede3bba9d Bump tokio from 1.29.1 to 1.30.0 (#2411)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.29.1 to 1.30.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...tokio-1.30.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 16:24:17 +02:00
Andrey Vasnetsov
47a03091f1 bump 1.4.1 (#2416) 2023-08-10 15:43:20 +02:00
Jesse
57ef69f954 Add batch update endpoint for points API (#1951)
* Add batch update endpoint for points API

* Add validation to batch update operation

* Update gRPC

* Add update and delete vector operations to point update batch

* Improve batch point update tests, add multivec, extract into module

---------

Co-authored-by: timvisee <tim@visee.me>
2023-08-10 14:11:02 +02:00
Andrey Vasnetsov
6ae3671d03 up to v1.4.0 (#2380) 2023-08-02 22:59:21 +02:00
Tim Visée
aae707c08f update collection: on_disk parameters (#2097)
* Add on_disk_payload field to collections params diff

* Add on_disk flag to update collection vector params

* Add on_disk parameters to collection update integration test

* Update and extend unit tests

* monitor on-disk params in optimizr

* fmt

* review fix

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-31 11:44:47 +02:00
Andrey Vasnetsov
72de3799e3 temporary exclude geo_polygon from API (#2352) 2023-07-31 11:42:50 +02:00
Tim Visée
029c21e3f7 Update collection: quantization config (#2090)
* Reoptimize segments on quantization mismatch

* Add collection quantization params to collection update REST endpoint

* Do not require rebuild of quantization for on_disk change

* Add collection quantization params to collection update gRPC endpoint

* Add option to update vector specific quantization config to REST API

* Add option to update vector specific quantization config to gRPC API

* Update OpenAPI and gRPC specification

* Fix quantization mismatch detecting not working as expected

* Fix config mismatch optimizer not using vector specific quantization

* Add unit test for quantization in config mismatch optimizer

* Add some quantization params to collection update integration test

* Reformat

* Apply suggestions from code review

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>

* Remove if-statement, simply return

* Move quantization params in named vector in integration test

* Test updating quantization params in multivec integration test

* Fix gRPC docs

* Fix quantization rebuild on changing enabled state on indexed segment

* allow disabling quantization config

* fmt

* clippy

* compare all params of the quantization for rebuild

* explicitly use params on update

* test for disabling quantization

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-31 11:42:38 +02:00
Tim Visée
482301cd00 Update collection: vector HNSW config (#2087)
* Add update vector config type

* Add mutable getter to update vector config

* Add update vector config to update collection REST operation, reorder

* Add logic to update vector HNSW in collection

* Update OpenAPI specification

* If HNSW diff is empty, consider it as unset

* Update descriptions to clarify an empty HNSW diff unsets

* Make new vector HNSW diff update existing diff

This means that the existing vector HNSW diff is kept intact. Specified
fields are updated in the existing diff. An empty HNSW diff object may
be provided to unset the diff.

* Add update vector config to update collection gRPC operation

* Update gRPC docs

* Use vector specific HNSW config in integration test

* Extract & improve gRPC type conversions, fix collection update with None

* Validate vector specific HNSW config in collection update gRPC endpoint

* Explicitly test we do not rebuild on on_disk change

* Use new method to recreate optimizers

* Don't test on_disk change anymore

* Reuse collection write lock to save, do not relock

* Fix invalid update collection request body in OpenAPI test

* Simplify update collection test

* Add update collection test for HNSW parameters

* Extract vector param update logic into local functions

* Reformat

* Transform UpdateVectorParams into VectorParamsDiff

* Transform UpdateVectorsConfig into VectorsConfigDiff

* Combine serde attributes

* Make HNSW diff empty check generic over DiffConfig types

* Move DiffConfig implementation

* Fix typo
2023-07-31 11:41:48 +02:00
Andrey Vasnetsov
5ad7c02814 Second thoughts on CJK tokenizer (#2260)
* charabia tokenizer for CJK, init

* add charabia to .proto

* generate grpc docs

* rename charabia to multilingual

* disable charabia default features

* ignore stopwords and separators in tokenizer

* fix rebase conflict

* fix test

* fix test

* Bump `charabia` crate version...

...and enable `charabia` features that does not require any additional dependencies by default

* Expose optional `charabia` features in the `segment` crate

* Expose optional `charabia` features in the `qdrant` crate

* fix codespell

* more regression tests

* more regression tests

* make language-specific tests feature-flagged

---------

Co-authored-by: Anatolii Smolianinov <zarkonesmall@gmail.com>
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-07-31 11:39:50 +02:00
Tim Visée
7baa296d8b Update collection: HNSW config (#2083)
* Add field to REST collection update to change HNSW config

* Add field to gRPC collection update to change HNSW config

* Update OpenAPI specification

* Update gRPC docs

* Improve optimizer filtering for excluded segment IDs

* Add config mismatch optimizer detecting basic HNSW mismatches

* Trigger optimizers when changing collection HNSW config

* Make config mismatch optimizer aware of vector specific HNSW configs

* Extract triggering optimizers after collection update into function

* Add config mismatch optimizer test for changing HNSW config

* Simplify config mismatch optimizer test

* Add config mismatch optimizer test for vector specific HNSW change

* Reformat

* Update collection HNSW params in integration test

* Validate HNSW config in collection update gRPC endpoint

* Improve description of update collection request

* Do not require to rebuild HNSW when on_disk flag changes

Ref: https://github.com/qdrant/qdrant/pull/2083#discussion_r1231002072

* Do rebuild segment with on_disk change

* Trigger optimizers in parallel

* Recreate optimizers only once on collection update

* Reformat

* Fix incorrect usage of self

* Fix deadlock in collection state config update

* Also rebuild index on full scan threshold change

* decompose worst_segment condition check

* review refactor

* Update lib/storage/src/content_manager/collection_meta_ops.rs

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

* Update lib/api/src/grpc/proto/collections.proto

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

* upd grpc docs

* upd grpc docs

* update openapi

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2023-07-31 11:39:36 +02:00
Zein Wen
bd40a58e65 Add geo_polygon filter to proto interface, complete conversion fn, and add an integration test (#2188) 2023-07-31 11:38:33 +02:00
Yaroslav Halchenko
462ce6ba05 codespell: workflow, config, typos fixed (#2248)
* Add github action to codespell master on push and PRs

* Add rudimentary codespell config

* some skips

* fix some ambigous typos

* [DATALAD RUNCMD] run codespell throughout

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* Add dev branch as target for the workflow
2023-07-31 11:37:32 +02:00
Luis Cossío
112005e32c Expose & benchmark binary index (#2174)
* expose boolean index

* benchmark against keyword and no index

* add integration tests

* rename benchmark groups
2023-07-31 11:37:24 +02:00
Tim Visée
7164ac4a59 Bump version to 1.3.2 (#2253) 2023-07-12 16:34:44 +02:00
Luis Cossío
ca989f9502 remove unused Serialize derives in build.rs (#2225) 2023-07-12 15:41:26 +02:00
Tim Visée
904e0ef5a1 Bump version to v1.3.1 (#2194) 2023-07-03 17:13:10 +02:00
dependabot[bot]
1310b74157 Bump tokio from 1.29.0 to 1.29.1 (#2177)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.29.0 to 1.29.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.29.0...tokio-1.29.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 16:29:38 +02:00
dependabot[bot]
0ccdbe94a7 Bump tokio from 1.28.2 to 1.29.0 (#2170)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.2 to 1.29.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.2...tokio-1.29.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 16:27:03 +02:00
Tim Visée
f927d0f17e Validate oversampling (#2100)
* Use unwrap_or_default rather than constructing it manually

* Validate oversampling parameter and surrounding structs

* Validate search limit to be 1 or higher

* Validate hnsw_ef parameter to be 4 or higher

* Also validate parameters in in gRPC

* Update OpenAPI specification

* Add unlikely to reach comment

* Remove hnsw_ef validation rules for now

* Update OpenAPI specification
2023-07-03 16:26:32 +02:00
dependabot[bot]
7eb982d8b8 Bump uuid from 1.3.4 to 1.4.0 (#2159)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.3.4 to 1.4.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.3.4...1.4.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 16:25:42 +02:00
Andrey Vasnetsov
6f9e2c869f bump version (#2140) 2023-06-23 13:24:23 +02:00
Andrey Vasnetsov
481e232339 fix todo (#2089) 2023-06-19 15:24:08 +02:00
Tim Visée
85aeea438f Increase HTTP2 reset stream limit for internal gRPC (#1928)
* Change gRPC channel pool connection limit to 1024

* Patch temporary tonic fork for newly exposed property

* Change internal gRPC `http2_max_pending_accept_reset_streams` to 1024

* Change to qdrant/tonic fork
2023-06-19 15:23:59 +02:00
Andrey Vasnetsov
0fcd373320 oversampling (#2070)
* wip: add rest param

* WIP: Refactor `search_with_graph` to use oversampling

* fixup! WIP: Refactor `search_with_graph` to use oversampling

Fix `search_with_graph` quantization config handling

* fixup! WIP: Refactor `search_with_graph` to use oversampling

Use `truncate` instead of `shrink_to` 🤦‍♀️

* schrink -> truncate

* protection against wrong oversampling value

* Revert second "fixup! WIP: Refactor `search_with_graph` to use oversampling"

Accidentally commited the wrong file 🤦‍♀️

* fix max method notation

* rollbacK: max notation

* Add `oversampling` field to `QuantizationSearchParams` gRPC type

* Simplify `oversampled_top` calculation

* `./tools/generate_grpc_docs.sh`

* `./tools/generate_openapi_models.sh`

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-19 15:23:54 +02:00
Luis Cossío
ce3a108312 Lookup: expose feature to REST and gRPC interfaces (#2011)
* rename `Lookup` -> `RetrievedLookup`

* feat: expose lookup in groups

- make `with_vectors` and `with_payload` optional
- include in grpc
- move GroupId to inside of PointGroup message
- include `WithLookup` inside of `GroupRequest`, doesn't make sense to keep them separated

* chore: remove allow(dead_code) from builder

* feat: introduce `WithLookupInterface` to allow specifying only the name of the lookup collection

* fix: WithLookupInterface with collection name only brings all payload and vectors

* fix: update grpc docs

* add tests and set better defaults

* remove `RetrievedLookup` from proto

* short-circuit `fill_search_result_with_payload` when it's not needed

* cargo fmt

* proto: revert putting `GroupId` inside `PointGroup`

* update grpc docs

* Remove WithLookupInterface sugar from grpc

- set with_vectors of lookup default to false
- set with_payload of lookup default to true

* update integration tests

* use singular lookup

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-06-19 15:18:19 +02:00
SunisDown
96678ff28d fix: validate collection name while creating collection (#1990)
* fix: validate collection name while creating collection

* fix: validate collection name for Windows

* Use simpler method for checking if collection name contains illegal char

* Add strict collection name validation to gRPC create collection

* Add strict collection name validation to REST create collection

* Add validation error rendering for does_not_contain

* Remove collection name validation from storage internals

* Add some test cases for stricter collection name validation

* Revert ToC changes

---------

Co-authored-by: timvisee <tim@visee.me>
2023-06-19 14:54:10 +02:00
Luis Cossío
da78899bab Lookup: add lookup feature to group_by (#1996)
* feat: add GroupBy builder
- move PointGroup to `collection` crate
- make GroupBy struct to add lookup feature in a builder pattern

* test: add happy GroupBy tests
- restructure grouping tests into own file
- fix GroupId precedence of i64 vs u64

* update openapi schema

* fix rebase

* tests: minor refactor

* refactor: integrate lookup params into GroupRequest
- rename `Lookup` -> `RetrievedLookup`
- rename `LookupRequest` -> `WithLookup`

* fix: rename `lookup` -> `with_lookup` and set options on tests
- use @timvisee 's suggestion on builder.rs

* refactor: remove `RetrievedLookup` enum

* update openapi
2023-06-19 14:53:31 +02:00
Tim Visée
77921a3a68 Update Cargo.toml, specify license and other things (#1943)
* Add Apache 2.0 license to crates

* Remove cargo reference comments

* Use consistent authors list in crates

* Specify README, homepage and repository links in root crate

* Update authors
2023-06-19 14:52:21 +02:00
dependabot[bot]
99c3592f9b Bump tokio from 1.28.1 to 1.28.2 (#1985)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 14:38:39 +02:00
Arnaud Gourlay
034c380f2a Fix gRPC doc for shard_number (#1979) 2023-06-19 14:37:59 +02:00
Andrey Vasnetsov
60d226385d bump v1.2.2 2023-05-25 19:12:40 +02:00
Tim Visée
fd8c7d14c1 Bump version to v1.2.1 (#1976) 2023-05-25 17:12:33 +02:00
Andrey Vasnetsov
f6a8e4cb89 V1.2.0 (#1950)
* up to v1.2.0 + use only minor version in openapi docs

* fmt
2023-05-23 18:16:59 +02:00