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

gRPC API for Distance Matrix #5011

Merged
merged 8 commits into from
Sep 4, 2024
Merged

gRPC API for Distance Matrix #5011

merged 8 commits into from
Sep 4, 2024

Conversation

agourlay
Copy link
Member

@agourlay agourlay commented Sep 3, 2024

context: https://github.com/qdrant/qdrant/milestone/11

This PR adds gRPC endpoints to the new distance matrix API

@agourlay agourlay added this to the Distance matrix API milestone Sep 3, 2024
@agourlay agourlay marked this pull request as ready for review September 3, 2024 11:16
@@ -274,7 +274,13 @@ fn configure_validation(builder: Builder) -> Builder {
("QueryBatchPoints.timeout", "custom(function = \"crate::grpc::validate::validate_u64_range_min_1\")"),
("FacetCounts.collection_name", "length(min = 1, max = 255)"),
("FacetCounts.key", "length(min = 1)"),
("FacetCounts.timeout", "custom(function = \"crate::grpc::validate::validate_u64_range_min_1\")")
("FacetCounts.filter", ""),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added missing validation on FacetCounts.filter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@@ -13011,16 +13007,18 @@
]
},
"sample": {
"description": "How many points to select and search within.",
"description": "How many points to select and search within. Default is 10.",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to make sample and limit optional for the sake of consistency with other endpoints.

@agourlay agourlay requested review from coszio and generall September 3, 2024 11:29
@agourlay agourlay force-pushed the distance-matrix-gRPC-API branch 3 times, most recently from 0e3b3a9 to afd98a8 Compare September 3, 2024 14:18

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| offsets_row | [uint64](#uint64) | repeated | Row coordinates of the CRS matrix |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some investigation I realized that CRS stands for something else. What we are doing with offsets is more similar to the COO representation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation 👍
I will get this fixed.

@agourlay agourlay force-pushed the distance-matrix-gRPC-API branch from f9b6874 to ece3c13 Compare September 4, 2024 15:40
Comment on lines 637 to 638
repeated uint64 offsets_row = 1; // Row coordinates of the matrix
repeated uint64 offsets_col = 2; // Column coordinates ids of the matrix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

Suggested change
repeated uint64 offsets_row = 1; // Row coordinates of the matrix
repeated uint64 offsets_col = 2; // Column coordinates ids of the matrix
repeated uint64 row_indices = 1; // Row indices of the matrix
repeated uint64 col_indices = 2; // Column indices of the matrix

And same for REST

@agourlay agourlay merged commit 4f1ccbb into dev Sep 4, 2024
17 checks passed
@agourlay agourlay deleted the distance-matrix-gRPC-API branch September 4, 2024 18:25
timvisee pushed a commit that referenced this pull request Sep 17, 2024
* gRPC API for Distance Matrix

* generate API docs

* apply correct limit to sample

* add JWT tests

* pluralitiy

* fix COO naming

* drops COO as it trips codespell and is redundant

* clarify docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants