Understanding Ranged Search #36313
Unanswered
aerobinsonIV
asked this question in
Q&A and General discussion
Replies: 1 comment 2 replies
-
Two problems in your script:
This is the correct script:
The expected results:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I'm new to Milvus, vector DBs, most AI related stuff. I'm trying to get up to speed using a toy exercise. My goal is to create a 3-dimensional collection that stores colors, and be able to identify all entries similar to a particular color by using a ranged search. I'm stuck on getting Milvus to search by radius. When I try, it just returns everything in my collection, or up to
limit
entries.Since I'm going to make video tutorials on this stuff as I learn it, I've got a nifty Blender setup to illustrate this. I'm trying to do a search with radius 120 from point [0, 255, 0] (green).
I'm running Milvus 2.4.5, pulled from Dockerhub a few days ago.
Here's what I've done:
Create collection
Add items
And so on until the collection contains:
These are the 6 points shown in the image.
Load collection
I don't quite get why this is needed, but no problems yet.
Perform search
I'm expecting to get [0, 255, 0], [100, 255, 0], and [0, 255, 55] as in the picture. But it just returns all 6 points.$120^2$ , since according to this, https://youtu.be/6yLmbL1o3Ow?t=934 Milvus omits the square root part of the distance formula to increase performance. I've tried with and without specifying the L2 metric type in the search request. I've verified that the collection was properly set up to use the L2 metric using the
14400 is
describe
API path.I've also tried the equivalent search in Python:
This gives the same result of all 6 entries coming back.
Any help would be appreciated. I'm just a zoomer who copy pastes AI generated code so I don't fully grasp all of this 😇
Thanks in advance!
Relevant docs/discussions for convenience:
https://milvus.io/docs/single-vector-search.md#Range-search
https://milvus.io/api-reference/restful/v2.4.x/v2/Vector%20(v2)/Search.md
#31032
#27160
Beta Was this translation helpful? Give feedback.
All reactions