Repository navigation
feat: support the search API (alpha) from Dapr 1.19 - #1903
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>
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
Reject integers that cannot be represented exactly as doubles and preserve whole-number float values. Signed-off-by: Adepu Sri Charan <sricharan.adepu36@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no unresolved concerns, and the documented change includes shared validation plus broad unit and integration coverage for the new Search API and numeric improvements.
No open issues 🎉
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1903 +/- ##
============================================
+ Coverage 81.92% 82.59% +0.67%
- Complexity 3644 3851 +207
============================================
Files 329 346 +17
Lines 11340 11751 +411
Branches 1290 1326 +36
============================================
+ Hits 9290 9706 +416
+ Misses 1556 1550 -6
- Partials 494 495 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
hello @AdepuSriCharan can you take a look to my comment? |
|
sorry @AdepuSriCharan did not see you pushed the fix, thanks! |

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.