Commit Graph

289 Commits

Author SHA1 Message Date
Di Zhao
034b46e83e 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-08-16 10:56:44 +02:00
Andrey Vasnetsov
49b3ae57b2 Search timeout (#2293)
* pass atomic bool from local shard to raw scorer

* pass atomic bool from local shard to raw scorer

* is_stopped in async scorer

* fmt

* is_stopped in quantized scorer

* terminating scorer if stopped

* enable timeout in local_shard

* allow timeout configuration

* use tokio spawn to ensure timeout handling if request is dropped

* Revert "use tokio spawn to ensure timeout handling if request is dropped"

This reverts commit 1068cf48d4.

* use stopping guard instead of task

* report error if search request is stopped

* fmt

* refactor transient error handelling
2023-07-24 12:45:33 +02:00
Andrey Vasnetsov
dda8330e15 detect file extension better (#2272)
* detect file extension better

* fix clippy

* refactor + test
2023-07-17 17:10:52 +02:00
Zein Wen
79475ea972 Add geo_polygon filter to proto interface, complete conversion fn, and add an integration test (#2188) 2023-07-17 12:36:50 +02:00
Arnaud Gourlay
d984d751d7 Fix set payload index to handle type change (#2235) 2023-07-10 11:24:14 +02:00
Ivan Pleshkov
12423f910d Add missed vector preprocess (#2203)
* test missed preprocess after segment update

* missed preprocess

* remove preprocess_named_vectors fn

* are you happy clippy

* fix integration tests

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-05 00:30:15 +02:00
Luis Cossío
4527f1db81 Small refactor: remove duplicated indexed_points() function (#2103)
* remove duplicated `indexed_points()` function

* update for binary index
2023-07-03 13:25:54 -04: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
Arnaud Gourlay
5bb721e1fb Add debug info for flaky test Windows (#2039) 2023-06-09 13:45:50 +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
Arnaud Gourlay
fcf55b8943 merge integration binaries (segment) (#2033) 2023-06-07 08:46:49 +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
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
Ivan Pleshkov
e0848a37da Product quantization (#1615)
* product quantization

* update quantization version

* refactor

* change api

* PQ -> product rename

* fix grpc comment

* fix tests

* are you happy clippy

* quantization version up

* update quantization

* provide max threads for kmeans

* fix test build

* pq unit tests

* update quantization lib

* update quantization version

* update deleted flags for quantized raw scorer

* fix build

* are you happy fmt

* update grpc docs

* update openapi

* restore storage_builder.try_reserve_exact

* Update lib/segment/src/segment_constructor/segment_builder.rs

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

* Update lib/segment/src/vector_storage/quantized/quantized_raw_scorer.rs

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

* change pub to pub(super)

* Update lib/segment/src/vector_storage/quantized/quantized_vectors.rs

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

* rename to config_exists

* Product quantization compression api (#1834)

* product quantization compression api

* update openapi and grpc docs

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

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

* fix test build

* are you happy fmt

* update grpc docs

---------

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

* product quantization with stopper (#1874)

* product quantization with stopper

* quantization version up

* fix build

* small comment fix

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2023-05-10 20:20:52 +04:00
Arnaud Gourlay
a18f5e9802 Nested object filter (#1602)
* nested object filter

* code review

* add support for must_not in nested

* extract functions

* support and test must_not in SimpleConditionChecker

* add index matching unit test (to be continued)

* remove extra clone

* test with should

* WIP: Nested object filter suggestions (#1855)

* switch to bitvec

* fix clippy

* more tests

* fmt

* fix some tests

* add test with text

* support for nested should

* do not rely on indexes for nested queries & fix test

* use index to make index-aware checks in nested payload

* fix value-count tests

* re-fa-cto-ring

* fmt

---------

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

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-10 14:20:12 +02:00
Andrey Vasnetsov
83f8b50aca Dynamic mmap vector storage (#1838)
* wip: chunked mmap

* Fix typo

* insert and get methods

* dynamic bitvec

* clippy

* wip: vector storage

* wip: fmt

* wip: mmap chunks

* wip: mmap problems

* Share transmuted mutable reference over mmap

* option to enable appendable mmap vectors

* fmt

* rename storage status file

* update tests

* fix get deleted value range

* add recovery to vector storage tests

* add flush to tests

* fix transmute from immutable to mutable

* make transmuted pointer private

* remove unused unsafe functions

* force WAL flush if wait=true

* move wal flush into updater thread

* remove flush from update api

* Minimize pub visibility for specialized/dangerous functions

* Allocate vector with predefined capacity

* Inline format parameters

* Assert we have multiple chunks while testing, test is useless otherwise

* Remove unnecessary scope

* Remove unnecessary dereference

* Random bool has 0.5 as standard distribution, use iter::repeat_with

* Replace RemovableMmap::new with Default derive

* Rename len to num_flags

* Use Option replace as it is convention alongside take

* Add FileId enum to replace error prone manual ID rotating

* Use debug_assert_eq where applicable

* Refactor drop and set to replace

* Change default chunk size for chunked mmap vectors to 32MB

This change is made as per GitHub review, because allocating a few
storages with 128MB would take a significant amount of time and storage.

See: https://github.com/qdrant/qdrant/pull/1838#discussion_r1187215475

* Replace for-loops with iterators

* Draft: add typed mmap to improve code safety (#1860)

* Add typed mmap

* Replace some crude mmap usages with typed mmap

* Use typed mmap for deleted flags

* Simplify dynamic mmap flags a lot with new typed mmap, remove flags option

* Reformat

* Remove old mmap functions that are now unused

* Reimplement mmap locking for mmap_vectors

* Add MmapBitSlice tests

* Replace MmapChunk with new typed mmap

* Update docs

* Clean-up

* Disable alignment assertions on Windows for now

* Rename mmap lock to mlock to prevent confusion with lockable types

* one more small test

* Some review fixes

* Add aliasing note

* Add basic error handling in typed mmap constructors

* Use typed mmap error handling throughout project

* Move mmap type module to common

* Fix transmute functions being unsound

See https://github.com/qdrant/qdrant/pull/1860#discussion_r1188593854

---------

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

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2023-05-09 18:01:01 +02:00
Tim Visée
effac50dad Add gRPC interface to update/delete optional named vectors (#1816)
* Add segment entry function to update named vectors

* Use already available function to update existing vectors

We already had a segment function to update existing named vectors. This
change ensure we use that instead of separating it separately. As a
bonus, this adds support for setting multiple named vectors at once.

* Update set vectors ourselves, don't drop omitted vectors

* Refactor vector updating functions, separate update and replace

* Add basic vector ops, add update/delete functionality to segment updater

* Add internal and public gRPC types and actions for vectors

* Add gRPC API actions

* Reformat

* Add VectorOperations to vector ops, add basic validation

* Validate gRPC vector types

* Validate vector operation structs

* Construct PointIdsList through From trait

* Update gRPC docs

* Use VectorsSelector for vector deletions in gRPC

* Add support for updating multiple points/vectors in update vectors API

* Update gRPC docs

* Fix incorrect gRPC type numbering

* Return point ID error from vector update/delete functions if not found

* Fix disbalanced vectors test
2023-05-05 15:18:19 +02:00
Andrey Vasnetsov
3b95a8e045 undo vector-related changes in estimate_cardinality (#1806)
* undo vector-related changes in estimate_cardinality

* fix adjust_to_available_vectors
2023-04-29 10:04:39 +02:00
Tim Visée
d48cd31a36 Add optimizer for many deleted points, make aware of deleted points and vectors (#1758)
* Minor collection optimizer cleanup

* Make optimizers better aware of available vs soft deleted points

* Fix incorrect deleted state on proxy segment for double delete

* Rename upsert_vector to upsert_point, because we work with points

* Refactor point methods for more clear and consistent naming

* Replace internal_size in IdTracker with total_point_count

* Keep track of vector deletion count on storage creation

* Add sparse index optimizer, to optimize indexes with high deletion count

* Add minimum vector count threshold to sparse index optimizer

* Add sparse index optimizer test

* Use consistent naming, write vector in full everywhere

* Simplify vacuum optimizer a bit

* Merge sparse index optimizer into vacuum optimizer

* Improve update_from in segment builder by returning early

* More accurately count vectors in segment optimizer

* Remove random from vacuum optimizer tests to make them more reliable

* Don't expose the total points in segment info, use available points

* Process review feedback

* Compare available vectors against indexed ones in vacuum optimizer

This is much better than using the number of soft-deleted vectors when
the segment was created for calculations. Not to mention that value had
other problems as well.

* Remove create_deleted_vector_count field, update vacuum test parameters

* Potentially solve out of bound panic when building index

* Review fixes:

- Propagate deleted flags into payload hnsw building
- Use `total` number of points for building HNSW instead of number of
  available points
- minor refactoring of `hnsw_config` copy -> clone
- Better detection of `indexed_points` in HNSW

* fix assert condition

* Optional named vectors optimizer reveiw 2 (#1794)

* review with Ivan

* fmt

* remove available_vector_count from segment entry

* remove total_point_count from segment entry

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>

* rollback changes in deleted count in proxy segment

* improve vector threshold detection logic in optimized_segment_builder

* style changes

* fix propagate deleted points to vectors

* Fix typo in method name

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2023-04-28 10:36:58 +02:00
Tim Visée
9873ac88ec Make query planner aware of deleted points and vectors (#1757)
* Exclude deleted vectors from HNSW graph building stage

* When estimating query cardinality, use available points as baseline

We should not use the total number of points in a segment, because a
portion of it may be soft deleted. Instead, we use the available
(non-deleted) points as baseline.

* Add plain search check to unfiltered HNSW search due to deleted points

* Cardinality sampling on available points, ignore deleted named vectors

* Estimate available vectors in query planner, now consider deleted points

In the query planner, we want to know the number of available points as
accurately as possible. This isn't possible because we only know the
number of deletions and vectors can be deleted in two places: as point
or as vector. These deletions may overlap. This now estimates the number
of deleted vectors based on the segment state. It assumes that point and
vector deletions have an overlap of 20%. This is an arbitrary
percentage, but reflects an almost-worst scenario.

This improves because the number of deleted points wasn't considered at
all before.

* Remove unused function from trait

* Fix bench compilation error

* Fix typo in docs

* Base whether to do plain search in HNSW upon full scan threshold

* Remove index threshold from HNSW config, only use full scan threshold

* Simplify timer aggregator assignment in HNSW search

* Remove vector storage type from cardinality function parameters

* Propagate point deletes to all its vectors

* Check for deleted vectors first, this makes early return possible

Since point deletes are now propagated to vectors, deleted points are
included in vector deletions. Because of that we can check if the vector
is deleted first so we can return early and skip the point deletion
check.

For integrity we also check if the point is deleted, if the vector was
not. That is because it may happen that point deletions are not properly
propagated to vectors.

* Don't use arbitrary vector count estimation, use vector count directly

Before we had to estimate the number of vectors (for a named vector)
because vectors could be deleted as point or vector. Point deletes are
now propagated to vector deletes, that means we can simply use the
deleted vector count which is now much more accurate.

* When sampling IDs, check deleted vecs before deleted points

* On segment consistency check, delete vectors for deleted points

* Fix vector delete state not being kept when updating storage from other

* Fix segment builder skipping deleted vectors breaking offsets

* update segment to handle optional vectors + add test (#1781)

* update segment to handle optional vectors + add test

* Only update stored record when deleting if it wasn't deleted already

* Reformat comment

---------

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

* Fix missed vector name test, these are now marked as deleted

* upd test

* upd test

* Update consensus test

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-25 14:31:04 +02:00
Ivan Pleshkov
2a65308857 segment ordered deletion test (#1707) 2023-04-13 10:08:31 +03:00
Tim Visée
f5a14449a0 Add vector specific quantization configuration (#1680)
* Add QuantizationConfigDiff type

* Add quantization config diff to vector parameters

* Prefer vector config over collection config for quantization

* Update OpenAPI specification

* Validate quantization configuration quantile in 0.5-1.0 range

As per https://github.com/qdrant/qdrant/pull/1681

* Add test if check if vector specific quantization config is persisted

* Alias quantization to quantization_config in vector parameters

* Remove quantization config diff, use full vector specific config instead

* Regenerate OpenAPI specification and gRPC docs

* Fix compilation error

* Add error handling to quantization config conversions

* Fix quantization integration test, make HNSW test stricter
2023-04-10 21:39:43 +02:00
Tim Visée
b7c1ecfd5f Add vector specific HNSW configuration (#1675)
* Validate VectorConfig/VectorParams, remove obsolete validation

* Add HNSW config diff to vector parameters

* Validate params in collection config

* Add HNSW config to segment vector data config

* Add VectorsConfig params iterator for more elegant conversions

* Prefer vector HNSW config over collection config for building HNSW index

* Base segment vector param HNSW config on collection config

* General improvements

* Rewrite HNSW ef_construct extract function to also consider vector configs

* Update OpenAPI specification

* Add test to check if vector specific HNSW config is persisted

* review changes

* review changes

* Regenerate gRPC docs

* Fix test on Windows

* Regenerate OpenAPI specification

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-10 17:16:56 +02:00
Arnaud Gourlay
39e28282ee Handle ties scores in test assertions (#1597) 2023-03-27 13:47:42 +02:00
Ivan Pleshkov
faf1235333 Remove deleted flags from vector storage (#1561)
* remove deleted flags from vector storage

* remove deleted flags from mmap

* new simple vector storage format

* are you happy clippy

* remove id_tracker from raw_scorer

* revert vector storage format changes

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-15 14:05:07 +01:00
Ivan Pleshkov
84e6cd8290 Vector storages enum (#1533)
* separate scoring and data containing

* vector storage enum

* fix test build

* are you happy clippy

* review fixes
2023-03-09 09:43:20 +04:00
Ivan Pleshkov
5174388ab4 integrate quantized data to storages (#1311)
* integrate quantized data to storages

* revert gitignore

* are you happy clippy

* quantize in optimizer

* provide flag

* fix segfault

* skip quantization flag, update scores

* use quantization flag

* are you happy fmt

* use quantization flag

* quantized search test

* are you happy fmt

* refactor test, refactor scorer choosing

* are you happy fmt

* run quantization on segment builder

* decrease testing parameters

* simplify segment

* update version

* remove use_quantization flag

* provide quantization config

* quantization version up

* euclid dist

* add euclid test

* saveload

* fix initialization bugs

* quantization lib version up

* fix arm build

* refactor scorer selecting

* quant lib version up

* are you happy fmt

* are you happy fmt

* are you happy clippy

* add save/load test for simple storage

* add comments

* quantiles

* quantization mmap

* remove f32

* mmap test

* fix mmap slice

* fix mmap test

* use chunks for quantization storage

* fix build

* are you happy fmt

* update quantization library

* update quantization lib

* update quantization lib

* integrate api changes

* are you happy fmt

* change quantization api

* additional checks in tests

* update quantization version

* fix unit tests

* add quantization to storage config

* use quantization for all cardinality search cases

* Integrate quantization suggestions 2 (#1520)

* review api

* wip: refactor quantization integrations

* wip: refactor quantization integrations

* wip: fmt

* include quantization into snapshot

* fmt

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-03 17:46:17 +01:00
Arnaud Gourlay
2770a24766 Nested payload filters (#1487)
* Nested payload filters

* close ToDo + add parsing of multuiple array values

* fmt

* improve testing nested arrays

* fix NumericIndex to accumulate points_to_values mapping

* revert numberic index + strict array field access

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-02-23 15:57:12 +01:00
Arnaud Gourlay
3803af502d Access payload key through nested Array (#1465)
* Access payload key through nested Array

* support removal through array index

* propagate type changes

* fmt

* avoid allocating Vec of one element
2023-02-17 17:41:28 +01:00
Arnaud Gourlay
4c0f849749 Clippy rust 1.67 (#1406)
* inline format! args

* inline format! args

* explicit lifetime could be elided

* fmt
2023-01-26 17:48:52 +01:00
Andrey Vasnetsov
ca9545366d Fix flacky hnsw (#1383)
* use fixed seed in random generator

* fmt
2023-01-23 10:10:46 +01:00
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 Pleshkov
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
Arnaud Gourlay
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 Pleshkov
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 Pleshkov
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 Vasnetsov
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
Ivan Pleshkov
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
Gabriel Velo
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