Repository navigation
feat: support the search API (alpha) from Dapr 1.19 - #1903
Open
AdepuSriCharan wants to merge 4 commits into
Open
AdepuSriCharan wants to merge 4 commits into
AdepuSriCharan wants to merge 4 commits into
Conversation
Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
The check compared a number only with the double's shortest decimal form, so exact values such as 2^60 and Long.MIN_VALUE were rejected. A number is now accepted when it equals either the double's binary value or its decimal form. Adds unit tests for the number conversion in vector and search. Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
The sidecar accepts NaN and the infinities without an error, and a filter holding one matches the wrong records: on the in-memory stores, n < Infinity matched nothing. Double and Float now get the same finite check as the other number types. Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are present, and the change is supported by unit, integration, and CI validation covering the new Search API and shared Vector functionality.
No open issues 🎉
1 resolved since last review
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1903 +/- ##
============================================
+ Coverage 81.92% 82.50% +0.58%
- Complexity 3644 3829 +185
============================================
Files 329 344 +15
Lines 11340 11720 +380
Branches 1290 1325 +35
============================================
+ Hits 9290 9670 +380
Misses 1556 1556
Partials 494 494 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds support for the Search API (alpha) introduced in Dapr 1.19.
This is the second and last part of #1879; the vector part was merged in #1901. It follows the approved approach: vector first, then search, with the same structure.
The changes include:
DaprPreviewClientmethods for creating, reading, listing and deleting indexes, managing documents, and searching with a text or native query, a filter, sorting and pagination.DaprSearchClientusingDaprGrpcCalls, with domain types that keep generated protobuf classes out of the public API. As in vector,Searchis added where the proto name is generic, for exampleIndexSearchDocumentsRequestAlpha1forIndexDocumentsRequestAlpha1.SearchVectorHelperfor the validation and mapping that search and vector share, moved out ofDaprVectorClientin its own commit.SearchDocumentcontent is abyte[]holding a UTF-8 JSON object, as in the proto and the Go SDK. It doesn't go through the client'sDaprObjectSerializer, which can be replaced with a non-JSON one, while the sidecar requires a JSON object.byTextquery is rejected, because the sidecar would run it as match-all.SearchQuery.matchAll()asks for that explicitly.IndexingWaitTimeoutAction.FAIL_REQUESTdocuments that with client retries on,RetryPolicysends the write again afterDEADLINE_EXCEEDED.search.in-memory, and a working example.Fix to the vector code from #1901: numbers in filters and metadata now keep their value. Before,
1.1fwas sent as1.100000023841858, so it missed a stored1.1, and the long9007199254740993matched a record holding9007199254740992. Now a float is sent through its decimal form, and NaN, infinities and numbers a double can't hold exactly are rejected with anIllegalArgumentException.Testing:
Issue reference
Closes #1879. The
dapr/docsupdate follows in a separate PR.Checklist
dapr/docsupdate will follow in a separate PR.