Commit Graph
57 Commits
Author SHA1 Message Date
Arnaud Gourlay d77debf122 Clippy for Rust 1.66 (#1284) 2022-12-16 10:53:51 +01:00
Andrey Vasnetsov d05b2def10 allow set different M param for default HNSW and payload-related links (#1257)
* allow set different M param for default HNSW and payload-related links

* review fixes
2022-12-06 13:53:42 +01:00
Ivan PleshkovandAndrey Vasnetsov ac9538d5af Hnsw links memmap (#1211)
* add on disk key

* remove obsolete graph initialization

* remove obsolete max level

* update openapi

* graph links trait

* use mmap option

* same format for ram and mmap

* fix segment unit tests

* are you happy fmt

* are you happy clippy

* fix ci and add mmap test

* review fixes

* remove unused try-from

* fix version compatibility

* avoid loading from disk during conversion

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-11-25 11:47:52 +01:00
98fc5b2fa4 0.11.1 cherry picks (#1193)
* Complete feature road-map

* docs: add erare-humanum as a contributor for code (#1181)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* update rust version and fix clippy complains (#1190)

* handle collections transition from single-node to cluster (#1189)

* Update to v0.11.1 (#1191)

* update to v0.11.1

* also default version

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

* consensus_state to consensus_state

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-11-07 11:31:12 +01:00
Ivan PleshkovandAndrey Vasnetsov 44626bc80a exact search parameter (#1150)
* exact search parameter

* exact search test

* decrease attempts count because of test speed

* minor review fixes

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-20 15:39:21 +04:00
Andrey Vasnetsov ba26e2f85e Faster filtered scroll (#1003)
* faster filtered scroll for low cardinality filters

* add test

* scroll strategy heuristics
2022-09-12 17:55:56 +02:00
Ivan PleshkovandAndrey Vasnetsov f6b2186193 [WIP] Many named vectors per point (#958)
* many named vectors per point (segment-level)

* operation result for dim function

* beautifulized vector name

* fix naming bug

* segment version migration

* fmt

* add segment tests

* are you happy clippy

* fix build

* [WIP] many named vectors per point (collection-level) (#975)

* config and search

* fix placeholders for proxy segment move

* remove VectorType from collection

* are you happy fmt

* vectors in grps messages

* create collections with vectors

* segment holder fixes

* are you happy fmt

* remove default vector name placeholders

* are you happy fmt

* are you happy clippy

* fix build

* fix web api

* are you happy clippy

* are you happy fmt

* record vector&vectors

* openapi update

* fix openapi integration tests

* segment builder fix todo

* vector names for update from segment

* remove unwrap

* backward compatibility

* upd openapi

* backward compatible PointStruct

* upd openapi

* fix record back-comp

* fmt

* vector configuration backward compatibility

* fix vetor storage size estimation

* fmt

* multi-vec segment test + index test

* fmt

* api integration tests

* [WIP] Named vectors struct (#1002)

* move to separate file

* named vectors as struct

* use cow

* fix build

* keys iterator

* avoid copy in PointStruct -> get_vectors

* avoid another copy

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

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-09-11 20:59:23 +02:00
Andrey Vasnetsov b9eee55a9f Full text search (#963)
* allow additional params for payload field index

* fmt

* wip: full text index building

* fmt

* text search request

* text search request

* full text index persitance and loading

* fmt

* enable fts index in mapping

* clippy

* fix tests + add integration test

* review fixes: extend payload index test

* revert incedental change
2022-09-01 12:50:12 +02:00
Andrey Vasnetsov be38254ee8 small refactoring (#746)
* small refactoring

* fix tests
2022-09-01 12:36:28 +02:00
Andrey VasnetsovandArnaud Gourlay a2acca0345 Segment batch search (#813)
* batch search benchmark

* collect filter iterator in indexed search

* fmt

* fix

* fix

* fmt

* use new tempfile create

* auto batching

* Clippy fixes

* REST, gRPC and internal APIs

* fix bugs & less duplication

* two steps payload retrieval mechanism & fix duplication

* add proxy_segment implementation & tests

* add gRPC docs

* remove unused code (#950)

* only filter ids within a batch

* add more equivalence tests

* add integration test search vs batch

* assert more search options in tests

* cleanup assertions

* fix offset panic

* rename search batch API

* openapi spec

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-08-18 14:48:17 +02:00
f357bd5d9b Allow to flush segment in separate thread (#927)
* allow to flush segment in separate thread

* flush as separate function (#928)

* flush as separate function

* review suggestion

* reduce locks during vector scoring

* fmt

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

* don't run background flush twice

* Update lib/segment/src/segment.rs

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

* increase flush interval

* Update lib/segment/src/segment.rs

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

* are you happy fmt

* test background flush

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-08-15 13:47:52 +04:00
Russ Cam 8e1f2ca353 Use tempfile (#922)
This commit replaces tempdir with tempfile.
tempdir is archived.

Closes #544
2022-08-10 09:39:21 +02:00
Egor Ivkov 026bd040b0 Add import formatting rules (#820)
* Add import formatting rules

* Review fix: update rusty hook
2022-07-15 15:42:25 +03:00
Andrey Vasnetsov e983b07a15 Parallel hnsw building (#773)
* parallel hnsw building

* improve hnsw payload blocks condition

* update indexing optimizer condition

* fmt
2022-07-03 01:14:05 +02:00
Andrey Vasnetsov 850e937c2a Storage points tracking refactoring (#750)
* segment refactoring

* rm points iterator

* fmt
2022-06-27 15:17:09 +02:00
Andrey Vasnetsov 8e52c255ab add consensus configuration + lower log level + fix flickering test 2022-06-06 21:44:03 +02:00
c15981092a [WIP] [real-time index] Implement payloadstorage for structpayloadindex (#642)
* [real-time index] Extend FieldIndex enum and StructPayloadIndex with method from PayloadStorage

* [real-time index] add missing remove_point methods

* [real-time index] add new index to FieldIndex enum

* fix compile

* are you happy fmt

* merge load and remove

* fix test generics

* decrement points count

* remove from histogram

* simplify histogram usage

* [real-time index] remove old tests and fix clippy warnings

* histogram: method to derive range by size (#657)

* [real-time index] add histogram based payload_blocks implementation.

* payload blocks

* fmt

* clippy

* [real-time index] refactor Segment to use PayloadIndex instead of PayloadStorage.

* fix tests

* fmt

* clippy

* rename indexes

* remove redundent params

* add struct payload deletion test + fix delete payload in map index

* remove payload threshold

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-06-06 17:14:20 +02:00
Andrey Vasnetsov 2601c017de Smarter defaults (#637)
* auto segments number

* auto segments number

* replace vector number limits with vector size limits

* fmt
2022-06-01 18:09:38 +02:00
Andrey Vasnetsov 1b458780eb On disk payload storage (#634)
* implement on-disk payload storage

* fmt + clippy

* config param for on-disk payload storage

* upd openapi definitions

* add integration test with on-disk payload

* fix clippy

* review fixes

* fmt
2022-06-01 17:23:34 +02:00
Arnaud Gourlay 794384f301 document flaky test and add more info in case of failure (#535) 2022-05-02 15:23:56 +02:00
Andrey VasnetsovandArnaud Gourlay bc6df8bd12 Better use of column index (#461)
* fmt

* remove redundent condition checker

* remove condition_checker from test

* fmt

* enum_dispatch for payload storage

* rm unused imports

* fmt

* replace enum_dispatch with manual stuff

* fmt

* filter optiizer

* cargo fix

* fmt

* refactor callback approach to payload checking

* cargo fix

* cargo fix

* fix

* fmt

* more filtering condition random fixture types

* clippy

* fmt

* restore lost value counts test

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

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

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-04-19 16:04:55 +02:00
Andrey Vasnetsov bd3ef8c052 also consider the corner case in test (#474) 2022-04-13 14:00:33 +02:00
Andrey Vasnetsovandgabriel velo f7d52244a7 Column oriented filter context (#456)
* [WIP] column oriented filter context

* suggestion

* [WIP] fix lifetimes and add more checkers

* refactor and externd struct filter context

* fmt

* add type alias for the condition checker

* fmt

Co-authored-by: gabriel velo <gabriel.velo@gmail.com>
2022-04-11 17:48:07 +02:00
Andrey VasnetsovandEgor Ivkov ef67a2ec59 Condition search benchmark (#435)
* decouple payload index and vector storage

* wip: test fixtures

* conditional search benchmark

* fmt

* use arc iterator for filtered queries

* fmt

* enable all benches

* fix warn

* upd tests

* fmt

* Update lib/segment/src/fixtures/payload_context_fixture.rs

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>

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

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>
2022-04-11 17:43:02 +02:00
Andrey Vasnetsov ce21abf033 Values count condition (#439)
* add values_count condition

* fmt

* fix tests and clippy

* fmt
2022-04-05 14:31:53 +02:00
Andrey Vasnetsov b07428f620 Is empty condition (#423)
* is-empty condition

* fmt

* better assert

* fmt
2022-04-03 16:55:51 +02:00
Gabriel Velo c29c9a46d4 [json storage] Filtering context (#413)
* [WIP] add a basic filtering context scaffold

* add PlainFilterContext and StructFilterContext
2022-03-31 08:57:18 -03:00
Gabriel Velo f69a7b740f json as payload (#306)
add json as payload
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-03-21 07:09:10 -03:00
Arnaud GourlayandAndrey Vasnetsov 34048c6fed index geo payload (#366)
* index geo payload

* fix group_points_per_region

* code review: use entry API

* geohash into box for payload_blocks

* add failing test for investigation

* workaround for when exp < min

* test with 2 geo values per point

* fix rounding error in cardinality estimation

* fmt

* code review: decompose using Iterator of slices

* code review: handle points with severak geo payloads

* refactor

* fix review comments

* review fixes

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-03-20 13:10:08 +01:00
Arnaud Gourlay 747d069eb3 fix new clippy lints in 1.59 (#341) 2022-02-24 20:59:23 +01:00
Andrey Vasnetsov e45379e438 Better optimizer error reporting + small bug fixes (#316)
* optimizer error reporting, decouple data removing, optimizator fix

* fmt

* fmt + clippy

* update openapi
2022-02-16 09:59:11 +01:00
Gabriel Velo 4483ea0d60 fix: #101 Payload type consistency is not enforced. 2022-02-09 11:46:01 -03:00
Andrey Vasnetsov 65787f7f55 UUID as point id (#265)
* wip: u64 -> u128 + serialization tests

* breaking: use more flexible structure for saving point ids

* replace u64 external id type with enum

* update openapi definitions for uuid + fix retrieve point api + bash script tests
2022-01-31 13:18:07 +01:00
Arnaud Gourlay 4c73d1ba8f name threads for observability (#247) 2022-01-24 13:39:12 +01:00
Andrey Vasnetsov 0f91c9a5e2 [WIP] Force optimization stop #31 (#161)
* implement checking stop-flag in the optimization routine

* wip: optimization cancel test

* force optimization stop during the construction of vector index

* fix clippy
2022-01-18 15:06:42 +01:00
Prokudin AlexanderandAndrey Vasnetsov ee461ce0a6 Extend clippy to workspace and fix some warnings (#199)
* Fix clippy in linting workflow

* Add toolchain override flag

* Add components to toolchain installation explicitly

* Add --workspace flag to clippy to check all packages

* Remove unnecessary clones

* remove redundant .clone() calls

* fix wrong arguments order in tests (typo)

* Fix vec! macro usage in test

* Correct redundant assert! usages

* Provide a quick fix for 'unused' test function lint

* fix unsound Send + Sync

* fix clippy complains

* fmt

* fix clippy

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-01-17 23:33:26 +01:00
DaniilandDaniil Sunyaev 1ad529c315 Allow to include vector into search result (#176)
* feat(#50): include vector into search result

allow to specify 'with_vector' parameter in search api to get search results vector data

* test(#50): fix tests

* chore(#50): apply cargo fmt

* chore(#50): update api docs

run tools/generate_openapi_models.sh

Co-authored-by: Daniil Sunyaev <dasforrum@gmail.com>
2022-01-03 17:12:01 +01:00
Andrey Vasnetsov 77bc6899ec fix refactoring (#124) 2021-11-21 19:32:18 +01:00
Marcin Puc c603f0075e Add various refactorings (#118) 2021-11-10 21:32:25 +01:00
Andrey Vasnetsov bf3d8c2575 data consistency fixes and updates (#112)
* update segment version after completed update only

* more stable updates: check pre-existing points on update, fail recovery, WAL proper ack. check_unprocessed_points WIP

* switch to async channel

* perform update operations in a separate thread (#111)

* perform update operations in a separate thread

* ordered sending update signal

* locate a segment merging versioning bug

* rename id_mapper -> id_tracker

* per-record versioning

* clippy fixes

* cargo fmt

* rm limit of open files

* fail recovery test

* cargo fmt

* wait for worker stops befor dropping the runtime
2021-10-24 18:10:39 +02:00
f55e5aa7b7 Features/filter payload (#104)
* update more test

* update fmt

* reduce non usecode and update docker version

* update commend code

* update name filter

* renames and minor fixes

* fix linter

Co-authored-by: hai che <haiche@jobhop.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Andrey Vasnetsov <vasnetsov93@gmail.com>
2021-10-12 11:07:36 +02:00
Alexander Galibey f3e8194310 Remove AtomicRefCell wrapper for condition checker (#84) 2021-08-03 10:35:55 +02:00
Konstantin 93e0fb5c2c [CLIPPY] Fix the last portion of rules and enable CI check (#53)
* [CLIPPY] Fixed the warning for references of the user defined types

* [CLIPPY] Fix module naming issue

* [CLIPPY] Fix the last set of warnings and enable clippy check during CI

* Moved cargo fmt and cargo clippy into it's own action
2021-07-03 13:12:21 +02:00
Konstantin a667747369 Applied and enforced rust fmt code formatting tool (#48)
* Apply cargo fmt command

* Enabled cargo fmt on build
2021-06-29 10:17:50 +02:00
Andrey Vasnetsov cfc5beeac7 add payload schema to collection info + indexing fixes 2021-06-13 22:31:09 +02:00
Andrey Vasnetsov 3616631300 Filtrable hnsw (#26)
* raw points scorer

* raw point scorer for memmap storage

* search interface prepare

* graph binary saving + store PointOffsetId as u32

* WIP: entry points

* connect new link method

* update libs + search layer method + visited list + search context + update rust

* implement Euclid metric + always use MinHeap for priority queue

* small refactor

* search for 0 level entry

* update visited pool to be lock free and thread safe

* use ef_construct from graph layer struct + limit visited links to M

* add metric pre-processing before on vector upsert

* old hnsw heuristic

* save hnsw graph for export

* search method + tests

* small fixes

* add benchmark and profiler

* build time optimizations

* use SeaHash

* remove unsed benchmark

* merge hnsw graph function

* WIP:HNSW index build function

* HNSW build_index with additional indexing

* refactor fixtures

* graph save and load test

* test and fixes for filterable HNSW

* enable hnsw index for query planning

* fix cardinality estimation tests + remove query planner as class

* small refactor

* store full copy of collection settings with collection + allow partial override on creation #16

* API for updating collection parameters #16

* refactor: move collection error -> types

* report collection status in info API #17

* update OpenAPI Schema
2021-05-30 17:14:42 +02:00
Andrey Vasnetsov dba7c9e558 fix filter query cardinality estimation 2021-05-04 20:12:51 +02:00
Andrey Vasnetsov 46ba12a198 update readme + change filter structure 2021-04-06 14:12:46 +02:00
Andrey Vasnetsov e0636b4920 optimized segment building in a separate directory 2021-04-06 14:12:46 +02:00
Andrey Vasnetsov 0a91d3ae06 struct payload index segment test 2021-04-06 14:12:46 +02:00