Skip to content

Commit eab36d4

Browse files
authored
v1.14.0
* chore: Regen stubs with BRANCH=dev sh internal/tools/sync_proto.sh Signed-off-by: Anush008 <anushshetty90@gmail.com> * v1.14.0 (PART 2): Formula Expression Builders (#73) * feat: *Condition builders Signed-off-by: Anush008 <anushshetty90@gmail.com> * chore: Lint fix Signed-off-by: Anush008 <anushshetty90@gmail.com> * Update image_test.go * docs: Removed license year README.md * docs: Updated README.md * Update qdrant_test/image_test.go --------- Signed-off-by: Anush008 <anushshetty90@gmail.com> --------- Signed-off-by: Anush008 <anushshetty90@gmail.com>
1 parent 7866973 commit eab36d4

File tree

7 files changed

+4339
-2621
lines changed

7 files changed

+4339
-2621
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<a href="https://github.com/qdrant/go-client/actions/workflows/ci.yml"><img src="https://github.com/qdrant/go-client/actions/workflows/ci.yml/badge.svg?branch=master" alt="Tests"></a>
1212
<a href="https://github.com/qdrant/go-client/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-success" alt="Apache 2.0 License"></a>
1313
<a href="https://qdrant.to/discord"><img src="https://img.shields.io/badge/Discord-Qdrant-5865F2.svg?logo=discord" alt="Discord"></a>
14-
<a href="https://qdrant.to/roadmap"><img src="https://img.shields.io/badge/Roadmap-2024-bc1439.svg" alt="Roadmap 2024"></a>
14+
<a href="https://qdrant.to/roadmap"><img src="https://img.shields.io/badge/Roadmap-2025-bc1439.svg" alt="Roadmap 2025"></a>
1515
</p>
1616

1717
Go client library with handy utilities for interfacing with [Qdrant](https://qdrant.tech/).
@@ -54,7 +54,7 @@ import "github.com/qdrant/go-client/qdrant"
5454
client, err := qdrant.NewClient(&qdrant.Config{
5555
Host: "xyz-example.eu-central.aws.cloud.qdrant.io",
5656
Port: 6334,
57-
APIKey: "<paste-your-api-key-here>",
57+
APIKey: "<your-api-key>",
5858
UseTLS: true, // uses default config with minimum TLS version set to 1.3
5959
// TLSConfig: &tls.Config{...},
6060
// GrpcOptions: []grpc.DialOption{},
@@ -115,11 +115,11 @@ searchResult, err := client.Query(context.Background(), &qdrant.QueryPoints{
115115
})
116116
```
117117

118-
Search for similar vectors with filtering condition
118+
Search for similar vectors with a filtering condition
119119

120120
```go
121121
searchResult, err := client.Query(context.Background(), &qdrant.QueryPoints{
122-
CollectionName: "test_collection",
122+
CollectionName: "{collection_name}",
123123
Query: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),
124124
Filter: &qdrant.Filter{
125125
Must: []*qdrant.Condition{
@@ -132,4 +132,4 @@ searchResult, err := client.Query(context.Background(), &qdrant.QueryPoints{
132132

133133
## ⚖️ LICENSE
134134

135-
Apache 2.0 © [2024](https://github.com/qdrant/go-client/blob/master/LICENSE)
135+
[Apache 2.0](https://github.com/qdrant/go-client/blob/master/LICENSE)

internal/proto/collections.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,25 @@ message StrictModeConfig {
341341
optional uint64 max_collection_payload_size_bytes = 13;
342342
optional uint64 filter_max_conditions = 14;
343343
optional uint64 condition_max_size = 15;
344+
optional StrictModeMultivectorConfig multivector_config = 16;
345+
optional StrictModeSparseConfig sparse_config = 17;
346+
optional uint64 max_points_count = 18;
347+
}
348+
349+
message StrictModeSparseConfig {
350+
map<string, StrictModeSparse> sparse_config = 1;
351+
}
352+
353+
message StrictModeSparse {
354+
optional uint64 max_length = 10;
355+
}
356+
357+
message StrictModeMultivectorConfig {
358+
map<string, StrictModeMultivector> multivector_config = 1;
359+
}
360+
361+
message StrictModeMultivector {
362+
optional uint64 max_vectors = 1;
344363
}
345364

346365
message CreateCollection {

internal/proto/points.proto

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ enum RecommendStrategy {
424424
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
425425
// If the `max_neg_score` is chosen then it is squared and negated.
426426
BestScore = 1;
427+
428+
// Uses custom search objective. Compares against all inputs, sums all the scores.
429+
// Scores against positive vectors are added, against negatives are subtracted.
430+
SumScores = 2;
427431
}
428432

429433
message LookupLocation {
@@ -571,6 +575,70 @@ enum Sample {
571575
Random = 0;
572576
}
573577

578+
message Formula {
579+
Expression expression = 1;
580+
map<string, Value> defaults = 2;
581+
}
582+
583+
message Expression {
584+
oneof variant {
585+
float constant = 1;
586+
string variable = 2; // Payload key or reference to score.
587+
Condition condition = 3; // Payload condition. If true, becomes 1.0; otherwise 0.0
588+
GeoDistance geo_distance = 4; // Geographic distance in meters
589+
string datetime = 5; // Date-time constant
590+
string datetime_key = 6; // Payload key with date-time values
591+
MultExpression mult = 7; // Multiply
592+
SumExpression sum = 8; // Sum
593+
DivExpression div = 9; // Divide
594+
Expression neg = 10; // Negate
595+
Expression abs = 11; // Absolute value
596+
Expression sqrt = 12; // Square root
597+
PowExpression pow = 13; // Power
598+
Expression exp = 14; // Exponential
599+
Expression log10 = 15; // Logarithm
600+
Expression ln = 16; // Natural logarithm
601+
DecayParamsExpression exp_decay = 17; // Exponential decay
602+
DecayParamsExpression gauss_decay = 18; // Gaussian decay
603+
DecayParamsExpression lin_decay = 19; // Linear decay
604+
}
605+
}
606+
607+
message GeoDistance {
608+
GeoPoint origin = 1;
609+
string to = 2;
610+
}
611+
612+
message MultExpression {
613+
repeated Expression mult = 1;
614+
}
615+
616+
message SumExpression {
617+
repeated Expression sum = 1;
618+
}
619+
620+
message DivExpression {
621+
Expression left = 1;
622+
Expression right = 2;
623+
optional float by_zero_default = 3;
624+
}
625+
626+
message PowExpression {
627+
Expression base = 1;
628+
Expression exponent = 2;
629+
}
630+
631+
message DecayParamsExpression {
632+
// The variable to decay
633+
Expression x = 1;
634+
// The target value to start decaying from. Defaults to 0.
635+
optional Expression target = 2;
636+
// The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number.
637+
optional float scale = 3;
638+
// The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`.
639+
optional float midpoint = 4;
640+
}
641+
574642
message Query {
575643
oneof variant {
576644
VectorInput nearest = 1; // Find the nearest neighbors to this vector.
@@ -580,6 +648,7 @@ message Query {
580648
OrderBy order_by = 5; // Order the points by a payload field.
581649
Fusion fusion = 6; // Fuse the results of multiple prefetches.
582650
Sample sample = 7; // Sample points from the collection.
651+
Formula formula = 8; // Score boosting via an arbitrary formula
583652
}
584653
}
585654

@@ -760,6 +829,7 @@ message UpdateBatchPoints {
760829
message PointsOperationResponse {
761830
UpdateResult result = 1;
762831
double time = 2; // Time spent to process
832+
optional HardwareUsage usage = 3;
763833
}
764834

765835
message UpdateResult {
@@ -863,6 +933,7 @@ message ScrollResponse {
863933
optional PointId next_page_offset = 1; // Use this offset for the next query
864934
repeated RetrievedPoint result = 2;
865935
double time = 3; // Time spent to process
936+
optional HardwareUsage usage = 4;
866937
}
867938

868939
message CountResult {
@@ -881,6 +952,7 @@ message RetrievedPoint {
881952
message GetResponse {
882953
repeated RetrievedPoint result = 1;
883954
double time = 2; // Time spent to process
955+
optional HardwareUsage usage = 3;
884956
}
885957

886958
message RecommendResponse {
@@ -993,6 +1065,8 @@ message FieldCondition {
9931065
ValuesCount values_count = 6; // Check number of values for a specific field
9941066
GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon
9951067
DatetimeRange datetime_range = 8; // Check if datetime is within a given range
1068+
optional bool is_empty = 9; // Check if field is empty
1069+
optional bool is_null = 10; // Check if field is null
9961070
}
9971071

9981072
message Match {
@@ -1097,6 +1171,10 @@ message GeoPoint {
10971171

10981172
message HardwareUsage {
10991173
uint64 cpu = 1;
1100-
uint64 io_read = 2;
1101-
uint64 io_write = 3;
1174+
uint64 payload_io_read = 2;
1175+
uint64 payload_io_write = 3;
1176+
uint64 payload_index_io_read = 4;
1177+
uint64 payload_index_io_write = 5;
1178+
uint64 vector_io_read = 6;
1179+
uint64 vector_io_write = 7;
11021180
}

0 commit comments

Comments
 (0)