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

[Bug]: Partition Key doesn't appear to function in pymilvus? #2368

Closed
1 task done
drawnwren opened this issue Nov 21, 2024 · 2 comments
Closed
1 task done

[Bug]: Partition Key doesn't appear to function in pymilvus? #2368

drawnwren opened this issue Nov 21, 2024 · 2 comments
Labels
kind/bug Something isn't working

Comments

@drawnwren
Copy link

drawnwren commented Nov 21, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This is similar to #2331 but it got retagged as a feature request. The bug is:

collection.load()
milvus_client.search(data=data,filter="<partition_key> == 'a_partition_key'")
  1. This appears to be the only way to load partitions with pymilvus but this looks like it loads the entire collection and not just the relevant partition_key. Is there a way to only load the partition?
  2. When I do this search, I get results from all partitions. Not just "<partition_key> == 'a_partition_key'".

Expected Behavior

collection.load(partition_key="a_partition_key")

or something similar.

milvus_client.search(data=data, filter="<partition_key> == 'a_partition_key'"

should return results where only partition_key is "a_partition_key".

Steps/Code To Reproduce behavior

No response

Environment details

Pymilvus 2.4.9
Milvus Standalone docker container:latest

Anything else?

No response

@drawnwren drawnwren added the kind/bug Something isn't working label Nov 21, 2024
@drawnwren drawnwren changed the title [Bug]: [Bug]: Partition Key doesn't appear to function in pymilvus? Nov 21, 2024
@drawnwren
Copy link
Author

drawnwren commented Nov 21, 2024

Is this maybe a bug in the docs?

because some parts of the docs say to use expr="<partition_key> == 'a_partition_key'" and other parts say to use filter="<partition_key> == 'a_partition_key'"

edit: nevermind, no. I set both filter and expr and neither do anything with the partition_key == syntax

@drawnwren
Copy link
Author

So, for future reference the problem was that I was using Milvus() instead of MilvusClient(). The second is the only one that seems to support filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant