Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client for v1.12 #58

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions internal/proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,18 @@ enum ShardingMethod {
Custom = 1; // Shard by user-defined key
}

message StrictModeConfig {
optional bool enabled = 1;
optional uint32 max_query_limit = 2;
optional uint32 max_timeout = 3;
optional bool unindexed_filtering_retrieve = 4;
optional bool unindexed_filtering_update = 5;

optional uint32 search_max_hnsw_ef = 6;
optional bool search_allow_exact = 7;
optional float search_max_oversampling = 8;
}

message CreateCollection {
string collection_name = 1; // Name of the collection
reserved 2; // Deprecated
Expand All @@ -326,6 +338,7 @@ message CreateCollection {
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
optional ShardingMethod sharding_method = 15; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode
}

message UpdateCollection {
Expand Down Expand Up @@ -375,6 +388,7 @@ message CollectionConfig {
OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode.
}

enum TokenizerType {
Expand All @@ -391,8 +405,8 @@ message KeywordIndexParams {
}

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
bool range = 2; // If true - support ranges filters.
optional bool lookup = 1; // If true - support direct lookups.
optional bool range = 2; // If true - support ranges filters.
optional bool is_principal = 3; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
optional bool on_disk = 4; // If true - store index on disk.
}
Expand All @@ -410,6 +424,7 @@ message TextIndexParams {
optional bool lowercase = 2; // If true - all tokens will be lowercase
optional uint64 min_token_len = 3; // Minimal token length
optional uint64 max_token_len = 4; // Maximal token length
optional bool on_disk = 5; // If true - store index on disk.
}

message BoolIndexParams {
Expand Down
59 changes: 58 additions & 1 deletion internal/proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,59 @@ message QueryPointGroups {
optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
}

message FacetCounts {
string collection_name = 1; // Name of the collection
string key = 2; // Payload key of the facet
optional Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions.
optional uint64 limit = 4; // Max number of facets. Default is 10.
optional bool exact = 5; // If true, return exact counts, slower but useful for debugging purposes. Default is false.
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
}

message FacetValue {
oneof variant {
string string_value = 1; // String value from the facet
int64 integer_value = 2; // Integer value from the facet
bool bool_value = 3; // Boolean value from the facet
}
}

message FacetValueHit {
message FacetHit {
FacetValue value = 1; // Value from the facet
uint64 count = 2; // Number of points with this value
}

message SearchMatrixPoints {
string collection_name = 1; // Name of the collection
optional Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions.
optional uint64 sample = 3; // How many points to select and search within. Default is 10.
optional uint64 limit = 4; // How many neighbours per sample to find. Default is 3.
optional string using = 5; // Define which vector to use for querying. If missing, the default vector is is used.
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
}

message SearchMatrixPairs {
repeated SearchMatrixPair pairs = 1; // List of pairs of points with scores
}

message SearchMatrixPair {
PointId a = 1; // first id of the pair
PointId b = 2; // second id of the pair
float score = 3; // score of the pair
}

message SearchMatrixOffsets {
repeated uint64 offsets_row = 1; // Row indices of the matrix
repeated uint64 offsets_col = 2; // Column indices of the matrix
repeated float scores = 3; // Scores associated with matrix coordinates
repeated PointId ids = 4; // Ids of the points in order
}


message PointsUpdateOperation {
message PointStructList {
repeated PointStruct points = 1;
Expand Down Expand Up @@ -813,6 +855,21 @@ message UpdateBatchResponse {
double time = 2; // Time spent to process
}

message FacetResponse {
repeated FacetHit hits = 1;
double time = 2; // Time spent to process
}

message SearchMatrixPairsResponse {
SearchMatrixPairs result = 1;
double time = 2; // Time spent to process
}

message SearchMatrixOffsetsResponse {
SearchMatrixOffsets result = 1;
double time = 2; // Time spent to process
}

// ---------------------------------------------
// ------------- Filter Conditions -------------
// ---------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions internal/proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,16 @@ service Points {
Universally query points in a group fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
*/
rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {}
/*
Perform facet counts. For each value in the field, count the number of points that have this value and match the conditions.
*/
rpc Facet (FacetCounts) returns (FacetResponse) {}
/*
Compute distance matrix for sampled points with a pair based output format
*/
rpc SearchMatrixPairs (SearchMatrixPoints) returns (SearchMatrixPairsResponse) {}
/*
Compute distance matrix for sampled points with an offset based output format
*/
rpc SearchMatrixOffsets (SearchMatrixPoints) returns (SearchMatrixOffsetsResponse) {}
}
Loading