Commit Graph

1780 Commits

Author SHA1 Message Date
Tim Visée
30d24c717a Add debug message when segment storage has point and vector count mismatch (#2071) 2023-06-28 14:56:33 +02:00
dependabot[bot]
a1d38a497b 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-06-28 08:45:00 +02:00
Zein Wen
bdd65c7037 Add GeoPolygon and tests (#2139)
This commit introduces the GeoPolygon struct, representing a polygon defined by a list of coordinates. It includes the check_point method to determine if a given point is inside the polygon. Test cases validate the functionality for different scenarios.
2023-06-27 10:58:32 +02:00
dependabot[bot]
a3c4cf1a4b Bump geo from 0.25.0 to 0.25.1 (#2154)
Bumps [geo](https://github.com/georust/geo) from 0.25.0 to 0.25.1.
- [Changelog](https://github.com/georust/geo/blob/main/CHANGES.md)
- [Commits](https://github.com/georust/geo/compare/geo-0.25.0...geo-0.25.1)

---
updated-dependencies:
- dependency-name: geo
  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-26 22:35:06 +02:00
dependabot[bot]
b8c3067d0b Bump memmap2 from 0.7.0 to 0.7.1 (#2152)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.7.0 to 0.7.1.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: memmap2
  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-26 21:28:25 +02:00
dependabot[bot]
8a1bd35d88 Bump itertools from 0.10.5 to 0.11.0 (#2135)
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.5 to 0.11.0.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.11.0)

---
updated-dependencies:
- dependency-name: itertools
  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-06-26 09:02:22 +02:00
Andrey Vasnetsov
fe53fdeb82 delete points from id tracker on flush only (#2136)
* delete points from id tracker on flush only

* move delete-on-flush logic to db wrapper
2023-06-22 23:27:08 +02:00
Damien Castelltort
4f875f5d48 Configurable location of temporary snapshot files (#1960)
* Issue 1905: Configurable location for the tmp snapshot files

* Apply suggestions from code review

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

* fix code review suggestions

* clippy fix

* Propagate temp path, use configured dir for snapshot creation

* Use real temp dir in snapshot tests

* Mention default temporary snapshot file path in configuration

* Use temp everywhere rather than a mix of temp and tmp

* Use consistent naming for temporary snapshot directories

* Extract logic for temporary storage path into toc method

* Resolve clippy warnings

* Apply suggestions from code review

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-21 22:53:19 +02:00
Tim Visée
2d6f6a4019 Improve vector compatibility checks, fix dimensionality panic (#2124)
* Before inserting vector update, check for correct dimensions

* Improve vector name and data checking on segment level

* Optimize vector compatibility checking

* Remove obsolete vector dimensionality check

* Add test to ensure all segment functions catch bad input

* Test vector checking functions directly as well
2023-06-21 21:10:45 +02:00
Andrey Vasnetsov
1093401353 run all integration tests with on_disk=true and false (#2125)
* run all integration tests with on_disk=true and false

* fix env reading
2023-06-21 21:09:34 +02:00
Andrey Vasnetsov
0f10a7c635 check integrity of snapshot (#2122)
* check integrity of snapshot

* rename check_symlinks to find_symlink
2023-06-21 17:02:31 +02:00
Tim Visée
847f08c96f Fix unused io_uring warning on non-Linux platforms (#2110) 2023-06-20 13:18:04 +02:00
Tim Visée
858b3b3dbe Fix deleted.dat missing in mmap storage snapshot (#2112)
* Fix deleted.dat not being in snapshots

* Update storage test to assert the deleted file is listed

* Remove unused method
2023-06-20 12:44:22 +02:00
Andrey Vasnetsov
010e1686f3 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-15 11:57:57 +02:00
Luis Cossío
431f59c41b Optimize is_empty (#2073)
* optimize is_empty condition for hitting index

* Optimize is_null too, simplify checker

* refactor: introduce values_is_empty() for indexes
- use `.then()` instead of `&&`

* cargo fmt

* improve comments

* Revert "Optimize is_null too, simplify checker"

This reverts commit b9ebfe5ff2.

* changes from review

* update `test_is_empty_conditions` test for comparing indexed vs not indexed results
2023-06-14 13:56:16 -04:00
Roman Titov
de47d40180 Enable Segment::prefault_mmap_pages after load and optimization (#1791) (#1992)
* Enable `Segment::preheat_disk_cache` after load and optimization

* Add `black_box` to prevent compiler from optimizing memmap reads (#2081)

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-06-14 17:02:35 +02:00
Tim Visée
07dba86d08 Improve counting vectors in SegmentInfo (#2072)
* Correctly count vectors in segment info for normal segment

* Correctly count vectors in segment info for proxy segment

* Simplify available point count method

* Minor improvements

* Add unit test for point and vector counts in segment

* Add unit test for point and vector counts in proxy segment

* Improve vector counting for proxy segment
2023-06-14 12:57:06 +02:00
Andrey Vasnetsov
02d105db06 Uring error handelling (#2067)
* prevent garbage leak in case of uring read failure

* fmt

* Simplify `UringReader` error handling

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-13 16:13:40 +02:00
Tim Visée
aa16840ac7 Assume points with no mapping/delete flag are deleted (#2061)
* In scorers, assume a point is deleted if it has no deleted flag

* Cleanup
2023-06-13 15:44:57 +02:00
Andrey Vasnetsov
98184f1d02 WIP: Async uring vector storage (#2024)
* async raw scorer

* fmt

* Disable `async_raw_scorer` on non-Linux platforms

* Refactor `async_raw_scorer.rs`

* Conditionally enable `async_raw_scorer` in `segment` crate

* Add `async_scorer` config parameter to the config...

...and enable `async_raw_scorer`, if config parameter is set to `true`

* fixup! Add `async_scorer` config parameter to the config...

Fix tests

* Add basic `async_raw_scorer` test

* Extend `async_raw_scorer` tests to be more extensive

* Async uring vector storage io uring (#2041)

* replace tokio-uring with just low level io-uring

* fnt

* minor fixes

* add sync

* wip: try to use less submissions

* fmt

* fix uring size

* larger buffer

* check for overflow

* submit with re-try

* mmap owns uring context

* large disk parallelism

* rollbacK: large disk parallelism

* fix windows build

* explicitly panic on uring fail

* fix windows build again

* use async scorer in the quantization re-scoring

* refactor

* rename UringReader

* refactor buffers

* fix for windows

* error checking

* fix handing

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-12 19:53:23 +02:00
Arnaud Gourlay
5bb721e1fb Add debug info for flaky test Windows (#2039) 2023-06-09 13:45:50 +02:00
dependabot[bot]
114a8dcc87 Bump memmap2 from 0.6.2 to 0.7.0 (#2049)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.6.2 to 0.7.0.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.6.2...v0.7.0)

---
updated-dependencies:
- dependency-name: memmap2
  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-06-09 08:03:36 +02:00
Andrey Vasnetsov
a75420ddcc Fix batch request with duplicated filter (#2051)
* fix double usage of iterator

* tests
2023-06-09 00:05:00 +02:00
dependabot[bot]
b261ae6e6d Bump tempfile from 3.5.0 to 3.6.0 (#2042)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.5.0 to 3.6.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: tempfile
  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-06-08 08:43:55 +02:00
Arnaud Gourlay
fcf55b8943 merge integration binaries (segment) (#2033) 2023-06-07 08:46:49 +02:00
Roman Titov
f4cfac0bde Add prefault_mmap_pages method to the GraphLinksMmap (#1791) (#2012)
* Add `prefault_mmap_pages` method to the `HNSWIndex`

* Add name to the thread spawned by `Segment::prefault_mmap_pages`
2023-06-05 11:28:46 +02:00
Tim
0ca6c647e1 Fix warnings pointed out by cargo doc (#1997) 2023-06-05 10:20:21 +02:00
Luis Cossío
aac0a286b2 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-02 14:26:50 -04:00
Roman Titov
d9f8bb20b2 Implement Segment::prefault_mmap_pages method (#1791) (#1912)
* WIP: Implement simple `MMAP_POPULATE`/`MADV_WILLNEED` test/benchmark

* WIP: Implement memmapped file disk-cache preheat

* Implement memmapped file disk-cache preheat using global worker

* Implement memmapped file disk-cache preheat using explicitly propagated worker

* Implement memmapped file disk-cache preheat using global lock

* Simplify `preheat_disk_cache` implementation

* Revert few unnecessary changes

* Rename `preheat_disk_cache` to `prefault_mmap_pages`

* Simplify iteration in `prefault_mmap_pages` with `slice::chunks` (thanks, @timvisee!)

* Switch logs in `prefault_mmap_pages` from `debug` to `trace`
2023-06-01 12:55:49 +02:00
dependabot[bot]
bf84c5b451 Bump chrono from 0.4.25 to 0.4.26 (#2005)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.25 to 0.4.26.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.25...v0.4.26)

---
updated-dependencies:
- dependency-name: chrono
  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-01 09:42:55 +02:00
Roman Titov
502d6ab2e7 Extend SerdeWal to better track the last truncated-to WAL index (#1815) (#1868)
* Skip applied WAL operations on shard load

* fixup! Skip applied WAL operations on shard load

- Skip WAL operation up to the *minimal* persisted version
- Add explanation comment

* fixup! Skip applied WAL operations on shard load

- "beautify" `skip_while` expression
- handle version `0` corner case (and add explanation)

* Update `Segment::handle_version` comment

* Simplify `Segment::handle_version` a bit

* Refactor `check_unprocessed_points`

* fixup! Refactor `check_unprocessed_points`

Optimized `check_unprocessed_points`

* Revert `LocalShard::load_from_wal` and `check_unprocessed_points` changes

* Downgrade failure in `check_unprocessed_points` to a warning

* Persist/track the first un-truncated index in `SerdeWal`...

...and use it as first index for WAL operations

* fixup! Downgrade failure in `check_unprocessed_points` to a warning

Downgrade failure in `check_unprocessed_points` to a warning *during `LocalShard::load_from_wal`* 🙈

* fixup! Persist/track the first un-truncated index in `SerdeWal`...

Words...

* Fix a bug in `SerdeWal::truncated_prefix_entries_num` and add explanation comment

* Fix a bug in `SerdeWal::ack`

* prevent unnesessary savings, use json, never decrease ack index

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-31 23:15:55 +02:00
Tim Visée
d40ef29680 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-05-31 20:56:38 +02:00
Luis Cossío
b92d3f45cd Lookup internals (#1981)
* feat: add lookup_ids function
- rename GroupId -> PseudoId
- impl try_from PseudoId to PointIdType
- create lookup_ids function
- add tests

* fix: keep `GroupId` name in the openapi schema

* refactor: make new type for PseudoId

* refactor: make new `Lookup` output for lookup_ids()

* changes from review, thanks @agourlay
2023-05-31 14:23:46 -04:00
Tim Visée
d67bf1ce37 Update memmap2 to remove Windows specific edge case (#1964)
* Bump memmap2 to 0.6.2

* Remove empty mmap edge case handling for Windows, now fixed in memmap2
2023-05-31 10:41:59 +02:00
dependabot[bot]
1290f4dbb5 Bump chrono from 0.4.24 to 0.4.25 (#1987)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.24 to 0.4.25.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.24...v0.4.25)

---
updated-dependencies:
- dependency-name: chrono
  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-05-30 08:37:55 +02:00
Andrey Vasnetsov
c38d6e6d1d re-assign entry point for hnsw point insertion on each level (#1974) 2023-05-25 17:41:58 +02:00
Tim Visée
11ad14fea8 Use const fn where possible for serde defaults (#1949) 2023-05-25 16:41:03 +02:00
dependabot[bot]
137def6650 Bump criterion from 0.4.0 to 0.5.0 (#1955)
Bumps [criterion](https://github.com/bheisler/criterion.rs) from 0.4.0 to 0.5.0.
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.4.0...0.5.0)

---
updated-dependencies:
- dependency-name: criterion
  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-05-24 09:57:18 +02:00
Andrey Vasnetsov
d8c6231228 remove outdated check (#1941)
* remove outdated check

* disable module fixtures
2023-05-22 23:15:41 +02:00
Andrey Vasnetsov
d624512a94 Fixes for group-by (#1938)
* fix payload seletor

* clippy

* except cardinality estimation

* implement match except iterator and api

* use except instead of must-not + test

* Fix doc error

* Update lib/collection/src/grouping/group_by.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* Update lib/segment/src/vector_storage/mod.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/collection/src/grouping/group_by.rs

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

* Update lib/segment/src/index/field_index/map_index.rs

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

* Update lib/segment/src/index/field_index/map_index.rs [skip ci]

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

* fix: `except_on` and `match_on` now produce `Vec<Condition>`s

* Apply suggestions from code review (lib/segment/src/index/field_index/map_index.rs)

* fix: reset review suggestion

* Remove unnecessary move

* Use Rust idiomatic map_else rather than match-none-false

* is-null -> is-empty

* de-comment drop_collection

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2023-05-22 20:32:35 +02:00
Andrey Vasnetsov
60ce060a78 Rewrite nested filters again (#1935)
* working nested filters

* rm unused file

* add comment example

* todo

* remove nester checkers

* Box recursive generic Fn types

* Box recursive generic Fn types [2/2]

* Add optional ID tracker to check_payload, remove boxed closure (#1939)

* Add optional ID tracker to check_payload, remove boxed closure

* Replace some match with or_else

* Some nested filter improvements (#1940)

* Replace starts_with/substring with strip_prefix

* Transform for-if-let-check-return into any iterator

* Transform for-if-return into any iterator

* Add comment to describe why check_payload has no ID tracker

See: https://github.com/qdrant/qdrant/pull/1935#discussion_r1200437675

* Update lib/segment/src/payload_storage/query_checker.rs

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

* Update lib/segment/src/payload_storage/query_checker.rs

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

* fix clippy

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2023-05-22 20:08:12 +02:00
Andrey Vasnetsov
4a2e5bfa21 always save config after operation is done (#1936) 2023-05-22 10:05:42 +02:00
Andrey Vasnetsov
2b373dba48 reorder conditions (#1923) 2023-05-18 12:33:17 +02:00
Andrey Vasnetsov
be99de3e27 rename nested container (#1922) 2023-05-18 10:45:16 +02:00
dependabot[bot]
ca78a7bc3f Bump geo from 0.24.1 to 0.25.0 (#1915)
Bumps [geo](https://github.com/georust/geo) from 0.24.1 to 0.25.0.
- [Changelog](https://github.com/georust/geo/blob/main/CHANGES.md)
- [Commits](https://github.com/georust/geo/compare/geo-0.24.1...geo-0.25.0)

---
updated-dependencies:
- dependency-name: geo
  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-05-17 21:39:36 +02:00
Tim Visée
d98579a7f1 Don't store version of temp segment until payload indices are converted (#1913) 2023-05-17 13:52:58 +02:00
Tim Visée
14327e5e1c Refactor segment config (#1894)
* Clone current segment config to deprecated type

* Remove segment level quantization config from segment config

* Also deprecate current VectorDataConfig

* Update old segment migration to work with new refactoring

* Move index into vector data config

* Move vector data config migration logic into segment level

* Remove hnsw_config from vector data config

* Rename collection params to vector data conversions function

* Move storage type into vector data config

* Set appendable flag correctly

* Clean up and reformat

* Make segment on disk flag not optional

* Add appendable flag to segment config to replace storage type

* Remove storage type from segment config

* Deprecate storage type enum

* Use consistent variable naming

* Cleanup

* Add segment config migration for v0.5.0 to current

* Bump segment to 0.6.0

* Remove serde defaults for new storage and vector data config types

These default value configurations are not needed anymore, because these
structs are not used to deserialize old data. All current fields should
always be available in these structs. When new fields are added in new
functions, the serde default annotation must be set again.

* Cleanup

* Update OpenAPI specification

This updates the returned data structure on telemetry endpoints, as a
result of segment configuration refactoring.

* Fix quantization configuration not falling back to collection config

* Fix compiler warning when building in release mode

* Move deprecated type structs into compat module

* Update allow deprecated attributes

* Assign quantization config only in segment optimizer

* Remove unsued parameter

* Add vector storage type enum to vector data config

* Remove appendable and on_disk flags from segment and vector config

* Update OpenAPI specification

* add tests

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-17 09:49:55 +02:00
Tim Visée
dcb9b764d2 Remove mlock from mmap (#1903)
* Update mlock disabled comment

* Remove mlock functions from mmap
2023-05-16 12:06:28 +02:00
Ivan Pleshkov
b8c50ea6b9 add quantization files to appendable mmap files (#1893) 2023-05-16 09:53:08 +04:00
Luis Cossío
e90a03e00b Group by key (#1768)
* test: test must_not is_null

* vcs: ignore vscode files

* feat: group-by initial implementation

* cargo fmt

* refactor: same request behavior on reco and search

* refactor: get rid of RefCell

* refactor-fix: correct hashmap keys, and early stops

* chore: small improvements

* feat: groups aggregator

* fix: pull changes from other files

* cargo fix

* cargo fmt

* docs: edit docstrings

* allow dead code (while the complete feature is beint built)

* chore: restructure

* feat: introduce GroupKey, minor other improvements

* cargo fmt

* chore: specify aggregator visibility

* fix: oops, leaking "private" type

* refactor-fix: restructure and refactor group_by

* cargo fix

* fix: don't panic when there is no group-by field

* remove print statements

* amend: `>=`  -> `==`

* perf: remove double clone

* chore: sync aggregator from other branch

* chore: cleanup print statemets

* test: ignore big tests

* cargo fmt

* refactor: add early stop when the groups have been filled, improve code

* chore: sync aggregator, remove print from test

* refactor: consider shard_selection, improve collection_by_name handling

* feat: add bucketing to table of content

* refactor: better errors, improve tests

* test: add integration tests

* feat: add endpoints

* refactor: introduce ScoredPoint wrapper, restructure types

* sync aggregator

* edit internal grouping visibility

* feat: group_by internals

* cargo fmt

* cargo fmt

* refactor: turn inner fn into closure

* test: fix test to support new vector output representation

* feat: wire up grouping with actix

* expose grouped_by field

* fix: change output group format

* feat: wire up openapi

* fix: finish wiring up grouping in actix

* tests: fix test_group.py

* cargo fmt

* refactor: extract constants

* remove Hash from ScoredPoint

* `Option<collection_by_name>` -> `collection_by_name`

* fix: handle better cases on `match_on`

* fix: consider that subsequent calls can bring better results

* cargo fmt

* fix clippy warnings

* cargo fmt

* refactor: move `Group` to `types`, localize `hydrate_from`, remove `Deref` impls

* refactor `add_points`

* refactor: turn `GroupKey` into enum

* refactor: make `HashablePoint` inner struct private

* feat: add grpc layer, make new `PointGroup` type to use as output

* fix: update openapi models

* docs: update grpc docs

* fix merge errors

* refactor: add BaseGroupRequest to make code DRYer, improve doc comments

* cargo fmt

* perf: increase precision; choose best groups by score

* misc: add more integration tests, fix review comments

* cargo fmt

* fix: reimplement interface to flatten search and recommend requests, excluding offset

* cargo fmt

* refactor: move `r#do` impl to `GroupRequest`

* fix: update grpc docs

* perf: sort in reverse order

* fix: use fist value of a Value::Array

* fix: validate group_by to not support bracket notation, fix int. tests

* fix: update grpc validation

* tests: update collection_tests

* refactor: move validation to the api layers

* Oops: reupdate tests

* refactor: let the derives derive (thanks @ffuugoo)

* refactor: use a new GroupId on the output

also increases performance by copying less

* remove hashable set, take ordering into an account, fix mutliple groups values support

* fmt

* refactor group_id + rename per_group -> group_size, fix clippy

* remove GroupKey wrapper

* @agourlay review fixes

* refactor: `group_min_scores` and `group_max_scores` ->  `group_best_scores`

* refactor: use set difference on `keys_of_unfilled_best_groups`

* refactor: use set intersection on `len_of_filled_best_groups`

* refactor: turn best_group_keys into iterator

* fix: remove [] syntax limitation

* fix: update openapi.json

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-15 23:05:20 +02:00