Skip to content

Commit

Permalink
V1.11.0 (#82)
Browse files Browse the repository at this point in the history
* update grpc

* update rest

* version up

* integration test qdrant version up

* use dev version in integration test (temp)

* update grpc

* update openapi

* Update latest Qdrant version to v1.11.0

---------

Co-authored-by: timvisee <[email protected]>
  • Loading branch information
IvanPleshkov and timvisee authored Aug 12, 2024
1 parent 2bfeb3f commit 56676d1
Show file tree
Hide file tree
Showing 18 changed files with 1,481 additions and 163 deletions.
2 changes: 1 addition & 1 deletion examples/node-js-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "Qdrant Team",
"license": "Apache-2.0",
"dependencies": {
"@qdrant/qdrant-js": "^1.10.0"
"@qdrant/qdrant-js": "^1.11.0"
}
}
6 changes: 6 additions & 0 deletions packages/js-client-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @qdrant/js-client-grpc

## 1.11.0

### Minor Changes

- Qdrant v1.11.0 API

## 1.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qdrant/js-client-grpc",
"version": "1.10.0",
"version": "1.11.0",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8"
Expand Down
51 changes: 47 additions & 4 deletions packages/js-client-grpc/proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ enum PayloadSchemaType {
Text = 5;
Bool = 6;
Datetime = 7;
Uuid = 8;
}

enum QuantizationType {
Expand Down Expand Up @@ -385,22 +386,56 @@ enum TokenizerType {
Multilingual = 4;
}

message KeywordIndexParams {
optional bool is_tenant = 1; // If true - used for tenant optimization.
optional bool on_disk = 2; // If true - store index on disk.
}

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
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.
}

message FloatIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
optional bool is_principal = 2; // 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.
}

message GeoIndexParams {
}

message TextIndexParams {
TokenizerType tokenizer = 1; // Tokenizer type
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
}

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
bool range = 2; // If true - support ranges filters.
message BoolIndexParams {
}

message DatetimeIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
optional bool is_principal = 2; // 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.
}

message UuidIndexParams {
optional bool is_tenant = 1; // If true - used for tenant optimization.
optional bool on_disk = 2; // If true - store index on disk.
}

message PayloadIndexParams {
oneof index_params {
TextIndexParams text_index_params = 1; // Parameters for text index
KeywordIndexParams keyword_index_params = 3; // Parameters for keyword index
IntegerIndexParams integer_index_params = 2; // Parameters for integer index
FloatIndexParams float_index_params = 4; // Parameters for float index
GeoIndexParams geo_index_params = 5; // Parameters for geo index
TextIndexParams text_index_params = 1; // Parameters for text index
BoolIndexParams bool_index_params = 6; // Parameters for bool index
DatetimeIndexParams datetime_index_params = 7; // Parameters for datetime index
UuidIndexParams uuid_index_params = 8; // Parameters for uuid index
}
}

Expand Down Expand Up @@ -511,12 +546,20 @@ message ShardTransferInfo {
bool sync = 4; // If `true` transfer is a synchronization of a replicas; If `false` transfer is a moving of a shard from one peer to another
}

message ReshardingInfo {
uint32 shard_id = 1;
uint64 peer_id = 2;
optional ShardKey shard_key = 3;
}

message CollectionClusterInfoResponse {
uint64 peer_id = 1; // ID of this peer
uint64 shard_count = 2; // Total number of shards
repeated LocalShardInfo local_shards = 3; // Local shards
repeated RemoteShardInfo remote_shards = 4; // Remote shards
repeated ShardTransferInfo shard_transfers = 5; // Shard transfers
// TODO(resharding): enable on release:
// repeated ReshardingInfo resharding_operations = 6; // Resharding operations
}

message MoveShard {
Expand Down
72 changes: 62 additions & 10 deletions packages/js-client-grpc/proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ message VectorInput {
// ---------------------------------------------
// ----------------- ShardKeySelector ----------
// ---------------------------------------------

message ShardKeySelector {
repeated ShardKey shard_keys = 1; // List of shard keys which should be used in the request
}
Expand Down Expand Up @@ -112,6 +113,7 @@ message GetPoints {
optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response
optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards
optional uint64 timeout = 8; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message UpdatePointVectors {
Expand Down Expand Up @@ -173,6 +175,7 @@ enum FieldType {
FieldTypeText = 4;
FieldTypeBool = 5;
FieldTypeDatetime = 6;
FieldTypeUuid = 7;
}

message CreateFieldIndexCollection {
Expand Down Expand Up @@ -265,7 +268,7 @@ message SearchParams {
optional bool exact = 2;

/*
If set to true, search will ignore quantized vector data
If set to true, search will ignore quantized vector data
*/
optional QuantizationSearchParams quantization = 3;
/*
Expand Down Expand Up @@ -358,16 +361,17 @@ message ScrollPoints {
optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards
optional OrderBy order_by = 10; // Order the records by a payload field
optional uint64 timeout = 11; // If set, overrides global timeout setting for this request. Unit is seconds.
}

// How to use positive and negative vectors to find the results, default is `AverageVector`:
// How to use positive and negative vectors to find the results, default is `AverageVector`.
enum RecommendStrategy {
// Average positive and negative vectors and create a single query with the formula
// Average positive and negative vectors and create a single query with the formula
// `query = avg_pos + avg_pos - avg_neg`. Then performs normal search.
AverageVector = 0;

// Uses custom search objective. Each candidate is compared against all
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
// Uses custom search objective. Each candidate is compared against all
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
// If the `max_neg_score` is chosen then it is squared and negated.
BestScore = 1;
}
Expand Down Expand Up @@ -433,7 +437,7 @@ message RecommendPointGroups {
message TargetVector {
oneof target {
VectorExample single = 1;

// leaving extensibility for possibly adding multi-target
}
}
Expand Down Expand Up @@ -480,6 +484,7 @@ message CountPoints {
optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count
optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message RecommendInput {
Expand All @@ -504,6 +509,16 @@ message ContextInput {

enum Fusion {
RRF = 0; // Reciprocal Rank Fusion
DBSF = 1; // Distribution-Based Score Fusion
}

// Sample points from the collection
//
// Available sampling methods:
//
// * `random` - Random sampling
enum Sample {
Random = 0;
}

message Query {
Expand All @@ -514,6 +529,7 @@ message Query {
ContextInput context = 4; // Return points that live in positive areas.
OrderBy order_by = 5; // Order the points by a payload field.
Fusion fusion = 6; // Fuse the results of multiple prefetches.
Sample sample = 7; // Sample points from the collection.
}
}

Expand Down Expand Up @@ -553,6 +569,37 @@ message QueryBatchPoints {
optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message QueryPointGroups {
string collection_name = 1; // Name of the collection
repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs.
optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used.
optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions.
optional SearchParams params = 6; // Search params for when there is no prefetch.
optional float score_threshold = 7; // Return points with scores better than this threshold.
WithPayloadSelector with_payload = 8; // Options for specifying which payload to include or not
optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response
optional LookupLocation lookup_from = 10; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
optional uint64 limit = 11; // Max number of points. Default is 3.
optional uint64 group_size = 12; // Maximum amount of points to return per group. Default to 10.
string group_by = 13; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups.
optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
optional uint64 timeout = 16; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ShardKeySelector shard_key_selector = 17; // 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
}
}

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

message PointsUpdateOperation {
message PointStructList {
repeated PointStruct points = 1;
Expand Down Expand Up @@ -666,7 +713,7 @@ message GroupId {

message PointGroup {
GroupId id = 1; // Group id
repeated ScoredPoint hits = 2; // Points in the group
repeated ScoredPoint hits = 2; // Points in the group
RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id
}

Expand All @@ -689,6 +736,11 @@ message QueryBatchResponse {
double time = 2; // Time spent to process
}

message QueryGroupsResponse {
GroupsResult result = 1;
double time = 2; // Time spent to process
}

message BatchResult {
repeated ScoredPoint result = 1;
}
Expand Down Expand Up @@ -770,12 +822,12 @@ message Filter {
repeated Condition should = 1; // At least one of those conditions should match
repeated Condition must = 2; // All conditions must match
repeated Condition must_not = 3; // All conditions must NOT match
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
}

message MinShould {
repeated Condition conditions = 1;
uint64 min_count = 2;
repeated Condition conditions = 1;
uint64 min_count = 2;
}

message Condition {
Expand Down
4 changes: 4 additions & 0 deletions packages/js-client-grpc/proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,8 @@ service Points {
Universally query points in a batch fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
*/
rpc QueryBatch (QueryBatchPoints) returns (QueryBatchResponse) {}
/*
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) {}
}
Loading

0 comments on commit 56676d1

Please sign in to comment.