Commit Graph

223 Commits

Author SHA1 Message Date
eltu
aa0f49798e Full-Text Index ASCII Folding (Normalization) (#7408)
* Add ASCII folding to tokenization process

Introduced an optional ASCII folding feature within the `TokensProcessor` to normalize non-ASCII characters to their ASCII equivalents. Updated tests and documentation to reflect the changes.

* Refactor tokenization code for improved readability and maintainability

Reorganized and reformatted the tokenization module, including `TokensProcessor` initialization and ASCII folding mappings for better clarity. Updated tests to align with the changes.

* Update test cases to reflect optional tokenizer settings changes

Adjusted `ascii_folding`, `lowercase`, and `phrase_matching` settings in tests to `None` where applicable, aligning with updates in tokenizer configuration defaults.

* address review remarks

* fix codespell

* thx coderabbit

* Don't copy tokens that are already ASCII

* Shrink folded string to fit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: timvisee <tim@visee.me>
2025-10-16 13:53:01 +02:00
xzfc
95b4bbf978 Rename HnswConfig::{copy_vectors -> inline_storage} (#7389) 2025-10-13 10:08:06 +00:00
xzfc
780d406ff8 Add CollectionInfo::warnings field (#7293)
* refactor: swap DiffConfig parmeters

was: diff.update(&config)
now: config.update(diff)

* refactor: introduce DiffConfig::update_opt

* feat: add CollectionInfo::configuration_status field

* rename ConfigurationStatus to CollectionWarning
2025-09-29 18:17:03 +00:00
xzfc
22df6bc30a Integrate hnsw_with_vectors (#7232)
* StorageGraphLinksVectors::try_new, make GraphLinksVectorsLayout non-fallible

* Integrate hnsw_with_vectors

* remove unused function

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-09-18 17:36:48 +00:00
Arnaud Gourlay
bc13f01680 [strict-mode] Add max number of payload index count (#7222)
* [strict-mode] Add max number of payload index count

* improve docs and validation for StrictModeConfig

* fix from coderabbit

* test blocking access to payload indexes

* polish test
2025-09-15 13:12:40 +02:00
Tim Visée
160becbb46 Remove vectors_count (#7244)
* Remove deprecated vectors count from collection info

* Remove vectors count from shard info

* Update OpenAPI and gRPC spec

* Remove vectors count from example
2025-09-12 14:40:24 +02:00
tellet-q
ef6e926826 Add hw usage to Facet response (#7189)
* Add usage stats to Facet response
2025-09-01 11:25:17 +02:00
Andrey Vasnetsov
e744bd6014 implement custom collection metadata (#7123)
* implement custom collection metadata

* persist metadata change

* Also unset a key in the test

---------

Co-authored-by: timvisee <tim@visee.me>
2025-08-26 11:49:17 +02:00
Andrey Vasnetsov
bf60e96619 filter text any (#7100)
* internal implementation for filter any

* implement api for match `text_any`

* allow naive implementation of text match any

* dedup after kmerge + renames

* improve `expected_should_estimation`

* congruence test

* openapi test

* setup index in each test

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-08-24 12:09:05 +02:00
Luis Cossío
a2d3270eb8 Custom RRF k parameter (#7065)
* allow custom K parameter for RRF

* generate grpc docs and openapi

* use tagged type approach for parametrized fusions

* use params approach in grpc

* simplify api structure

* upd schema

* nits

* rest: parameterized rrf as query variant

* consistency in doc comments

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-08-20 15:05:27 -04:00
Andrey Vasnetsov
c188f5b7c4 Update if (#7006)
* implement condition parameter for upsert operation

* fmt

* update api schema

* implement conditional update for update-vectors op

* rename to update_filter for consistency

* add tests

* explicilty ignore strict mode for conditional updates

* rabbit review fix

* Also assert vector element before, confirm we don't normalize

* Simplify filter creation using new helper

* Rename merge_with_ids to with_point_ids

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-08-15 15:47:43 +02:00
Kacper Łukawski
c5452933a2 Improve description of full_scan_threshold (#7033)
* Improve description of full_scan_threshold in configuration

* Update OpenAPI spec

* edit in grpc

* coderabbit nit

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-08-13 12:02:40 +02:00
Kumar Shivendu
34e18eb22c Allow retaining more closed segments (#6976)
* Retain more closed segments

* Add back rocksdb

* Update WalOptions/WalConfig across the code

* Use NonZeroUsize

* Expose via APIs

* Update gRPC docs

* Fix stoarge compat test

* recompile openapi.json with rocksdb

* default wal retain closed fn

* update openapi.json

* Use qdrant/wal latest commit and remove from config.yaml
2025-08-07 13:44:26 +02:00
Luis Cossío
a7701587f4 [decay formula] allow [0,1] range for midpoint in lin_decay (#6959)
* allow [0,1] range for midpoint in lindecay

* clippyyyyy

* Better error message
2025-08-01 13:49:54 -06:00
Tim Visée
a5869beb99 Deprecations for Qdrant 1.15.0 (#6892)
* Deprecate init_from

* Mark memmap_threshold as deprecated

* Mark locks API as deprecated

* Mark RBAC collection access payload filter as deprecated

* Allow deprecations in tests and benchmarks
2025-07-17 16:10:45 +02:00
Luis Cossío
6307510476 [MMR] expose as query variant in rest and grpc (#6797)
* expose mmr in rest and grpc

* fix referenced vectors in mmr queries

* rename to MmrInput in grpc for consistency

* mmr is now an optional parameter of nearest query

* fix score_threshold at local shard

* fix conversion of rest -> collection

* fix and refactor planned query

* nits

* rename `lambda` to `diversity` in interface

* handle score_threshold within mmr calculation

* add openapi test

* fix candidate limit at collection level

* candidate_limit -> candidates_limit

* finish rename to candidates_limit

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-11 10:39:12 -04:00
Luis Cossío
5a7972daf3 rename snowball params in grpc (#6839) 2025-07-09 15:40:06 -04:00
Andrey Vasnetsov
9ece0a27f1 rename stemming -> stemmer (#6827)
* rename stemming -> stemmer

* docs
2025-07-08 12:59:09 +02:00
Ivan Pleshkov
9dc393e1c0 Merge pull request #6201
* bq encodings

* update docs

* fix after rebase

* fix gpu build

* fix build after rebase
2025-07-03 14:44:21 +02:00
Jojii
b00a9081ba Implement stemming (#6770)
* Implement stemming

* minor fix

* Add openapi specs

* Fix import

* Fix Test, rename API type

* update openapi

* fix rest models

* Review remarks

* Minor code cleanup

* make grpc naming aligned with Rest + use master branch for dependencies

* grpc docs

* use tagged version

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-02 15:29:27 +02:00
Luis Cossío
6919e3ae5b [phrase matching] expose phrase condition (#6670)
* add `"match": { "phrase": ... }` condition

* gen grpc and openapi

* [phrase matching] expose `phrase_matching` flag in rest and grpc (#6620)

* expose setting in rest and grpc

* phrase matching openapi test

* regen openapi

* [phrase matching] Text index fixes (#6730)

* allow rocksdb-based immutable text index

* fix repeated-token phrases

* fmt

* Update OpenAPI spec

---------

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

* add repeated word case in openapi test

* [phrase match | strict mode] Allow phrase condition when enabled in index (#6749)

* allow phrase filter when index is present

* prettier error message

* clippppppy

---------

Co-authored-by: timvisee <tim@visee.me>
2025-06-24 16:56:36 -04:00
Tim Visée
42de66d5e6 Fix debug panic in issues API, specify integer index param defaults (#6753)
* Fix incorrect defaults for integer index params in issues API

* Specify default for integer index params in comment

* Update OpenAPI and gRPC spec
2025-06-24 17:23:32 +02:00
Ivan Pleshkov
fe5becdadd Merge pull request #6663
* bq encodings

* are you happy clippy

* are you happy clippy

* are you happy clippy

* are you happy clippy

* gpu tests

* update models

* are you happy fmt

* move additional bits to the end

* fix tests

* Welford's Algorithm

* review remarks

* are you happy clippy

* remove debug println in test

* coderabit nitpicks

* remove unnecessary clone and partialeq

* Use f64 for Welford's Algorithm

* try fix ci

* revert cargo-nextest

* add debug assertions
2025-06-19 18:21:00 +02:00
n0x29a
5dfe4b1db3 Add stopwords support (#6635)
* Add stopwords support

* Update codespell configuration and improve stopword assertion message

* Add stopwords schema to OpenAPI definition

* Rename StopwordsOption to StopwordsInterface

* Add stopwords support for multiple languages

* Update codespell configuration to skip all Rust files in stop_words directory

* Normalize stopwords to lowercase during insertion

* Add language aliases for stopwords

* + grpc

* Unspecified Language

* clippy fmt

* openapi

* Refactor to use BTreeSet

* update tokenizer test to include custom stopwords with contractions

* simplified grpc StopwordsInterface

* alias for languages

* use `lowercase` flag for stop word normalizing

* grpc: enum -> string

* consistent naming

* Remove UnspecifiedLanguage and use From for conversions

* fix conversions

* fmt

* use stopwords inside different tokenizer

* use ahash

* fix tests

* fix no-rocks-db feature

* simplify code and fix test

* update test

* fix clippy

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-06-16 12:48:21 +02:00
n0x29a
01e5fab950 InferenceUsage in grpc (#6601)
* InferenceUsage in grpc

* Update documentation for InferenceUsage

* Update lib/api/src/grpc/ops.rs

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

* clearer inference usage tracking

* remove unused inference token from delete_points

* review

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-29 21:48:35 +02:00
n0x29a
1dfebb5ea0 Add inference usage tracking to REST API (#6563)
* Add inference usage tracking to REST API

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-05-27 11:48:20 +02:00
n0x29a
73e7b17ee8 Refactor: move HardwareUsage to the Usage map (#6532)
---------

Co-authored-by: jojii <jojii@gmx.net>
2025-05-14 21:01:49 +02:00
Luis Cossío
5670a7c917 sum_scores recommendation strategy (#6256)
* Add in rest and grpc

* add to QueryEnum

* implement Query trait

* connect to scorer creation

* upd tests

* additional changes

* fmt

* gen openapi and grpc docs

* coderabbit fix

* add changes in async scorer

* test sum_scores in more places, refactor to remove repetition
2025-04-03 09:01:39 +02:00
Luis Cossío
ec544ff627 [score boosting] support datetime expressions (#6196)
* use f64 as internal expression score

* allow datetime as expression

* add test cases

* fix schema, generate openapi and grpc docs

* fmt

* clippy

* fix test precision

* graceful handling of too large numbers, more tests

* rename to DatetimeExpression for consistency

* use datetime's timestamp as seconds

* capture variable name when parsing

* homogenize DateTime into Datetime

* use interface distinction between datetime strings and payload keys

* fix rebase

* fix after rebase
2025-04-02 12:40:00 -03:00
Jojii
ae64690c7a Measure Payload Index IO Writes (#6137)
* Prepare measurement of index creation + Remove vector deletion
measurement

* add hw_counter to add_point functions

* Adjust add_point(..) function signatures

* Add new measurement type: payload index IO write

* Measure payload index IO writes

* Some Hw measurement performance improvements

* Review remarks

* Fix measurements in distributed setups

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-24 19:39:17 +01:00
Luis Cossío
e86629e8e4 [score boosting] Add decay expressions (#6154)
* Add decay expressions

* remove code duplication in conversion

* test and fix lambda roundtrip

* Remove debug print in decay midpoint validation

* Improve error messages for decay midpoint and scale validation

* use similar lambda for gauss and exp decays

* avoid abs before squaring

* add comment about decay range

* add debug assertion
2025-03-18 17:09:55 -03:00
Jojii
faeba71849 IO read measurements for most Payload indices (#5951)
* Add payload index filtering IO measurements for some indices

* Add payload index metric to api and telemetry

* Also account for index access overhead

* Review remarks

* Anonymize new HardwareUsage field

* Fix tests
2025-03-12 14:31:48 +01:00
Jojii
1fded093b7 Measure hardware IO for update operations (#5922)
* Measure update operations hardware IO

* Add support for distributed setups

* also measure update_local

* Add consensus tests for HW metrics of update operations

* add test for upserting without waiting

* Disable HW usage reporting when not waiting for update API

* Review remarks

* Fix resharding collecting hw measurements

* Fix metric type

* New struct HardwareData for better accumulation

* Ensure we always apply CPU multiplier

* Apply suggestions from code review

* Update src/actix/api/update_api.rs

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

* Fix assert_with_upper_bound_error threshold calculation.

* Clarifying why we don't measure shard cleanup

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-06 15:03:23 +01:00
Andrey Vasnetsov
ea6dc0a91a IsEmpty/IsNull index (#6088)
* create initial strucutres

* clippy

* start field-query refactoring

* start field-query refactoring (2/N)

* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition

* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet

* filter for is_empty/is_null

* implement add/remove point

* upd schema

* open and create of null-index

* create null-index

* fix test

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

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

* unit test for null-index

* more unit tests

* add openapi tests

* fmt

* fix for integartion tests

* rabbit review fix

* make [null] non-empty

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-04 13:19:50 +01:00
Luis Cossío
64ff5f0af5 [score boosting] add more expressions (#6054)
* sqrt, pow, exp, log, ln, abs

* upd openapi and grpc

* handle undefined math as negative infinity
2025-02-26 09:31:50 -03:00
Luis Cossío
b494771e61 [score boosting] add gRPC structures (#6035)
* add grpc structures

* grpc docs

* make by_zero_default optional
2025-02-24 10:44:46 -03:00
Arnaud Gourlay
1a7e2701d7 Add strict mode for max points count (#5967)
* Add strict mode for max points count

* clarify estimated nature
2025-02-12 11:10:51 +01:00
Jojii
bae4c08a2a Measure IO reads for vectors (#5912) 2025-02-03 11:56:43 +01:00
Jojii
5a321d6f09 HwCounter rename IO metrics (#5898)
* Rename io metrics and add vector_io_write

* Chore: Cleanup obsolete TODOs and simplify retrieving HardwareCounterCells (#5899)
2025-01-30 10:23:35 +01:00
n0x29a
1796c76e35 Strict mode sparsevector (#5841)
* Strict mode sparse vectors
* Update gRPC docs
* Use deny_unknown_fields (#5868)

---------

Co-authored-by: n0x29a <n0x29a@example.com>
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>
2025-01-23 17:34:38 +00:00
Arnaud Gourlay
4dee0c5bf4 Strict mode multivector (#5757)
* strict mode for multivector

* simplify impl

* regen docs
2025-01-20 15:53:35 +01:00
Tim Visée
7d57ee485f Resharding: expose direction in gRPC API (#5794)
* Expose resharding direction in gRPC API

* Trim whitespaces
2025-01-14 14:18:51 +01:00
Jojii
3e96fae333 [Strict mode] limits for filter and conditions (#5754)
* Add limits for filter and conditions

* clippy

* Review remarks + nested condition test

* Fix opnapi specs

* Improve error message by giving info about limits and usage
2025-01-14 11:07:27 +01:00
Jojii
9ad886691e IO metrics in hw counter types (#5769)
* io metrics in hw counter types

* Add new metrics to `new_with`
2025-01-10 18:28:34 +01:00
Tim Visée
306f4a88ce Resharding: expose operations in cluster info (#4599)
* Expose resharding operations in cluster info

* Fix collection info conversion to gRPC
2025-01-10 11:50:31 +01:00
Roman Titov
8beb1106a6 Abort scale-down resharding on update error (#5670) 2024-12-24 13:58:32 +01:00
Luis Cossío
daef7134e2 Enable resetting max_optimization_threads to automatic (#5634)
* Allow max-optimization-thread config to be set to null on update

* add new field. Support both, but prepare for deprecation.

* better openapi

* only introduce change in OptimizersConfigDiff

* move to `api::rest::schema`

* update openapi

* improve test, fix diff to config conversion

* upd grpc docs

* clippy

* remove schemars from common common

---------

Co-authored-by: Gulshan Kumar <kumargu@amazon.com>
2024-12-18 17:17:47 -03:00
Arnaud Gourlay
229fa94f69 Strict mode for payload storage (#5588)
* Strict mode for payload storage

* Don't increment counter multiple times per request

* Add (loose) integration tests for payload storage limit

* Minor improvements

* minor renaming

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

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

---------

Co-authored-by: jojii <jojii@gmx.net>
Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
2024-12-17 17:33:46 +01:00
Luis Cossío
14c1979a47 Integrate mmap bool index (#5571)
* add on_disk option for bool index

* test that all files are covered

* generate openapi and docs

* clippy

* remove `populate` changes

* use `walkdir` crate

* Apply clippy suggestions

---------

Co-authored-by: timvisee <tim@visee.me>
2024-12-16 20:35:10 -03:00
Arnaud Gourlay
2a2a7033db Rate limit requests per minute (#5597)
* Rate limit requests per minute

* rename to remove time unit for API
2024-12-10 00:26:37 +01:00