Skip to content

search by ids #42512

Jun 4, 2025 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

“id in [1,10,24,100...]”这样的文本表达式的长度进本就是rpc调用时允许的请求大小,受milvus.yaml中的这个配置限制,默认64MB:

proxy:
  grpc:
    serverMaxRecvSize: 67108864 # The maximum size of each RPC request that the proxy can receive, unit: byte

可以把这个配置改大,但最终会受限于protobuf的限制,最大2GB。
几百几千个id一般也就MB级别的长度,所以离这个上限还很远。
越长的表达式解析时耗时越长,对查询延时有影响。几百个影响也不大,几千个也许稍慢点,以实测为准。

在milvus 2.5版本里支持了以id array的形式传给server,称为expression template:https://milvus.io/docs/filtering-templating.md ,就是你说的类似功能。

java sdk的用例如下:
https://github.com/milvus-io/milvus-sdk-java/blob/90b594a80c7e4cea792f7c252fb1642c76257469/examples/src/main/java/io/milvus/v2/SimpleExample.java#L108

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ztyf-lq
Comment options

@yhmo
Comment options

yhmo Jun 4, 2025
Collaborator

Answer selected by ztyf-lq
@xiaofan-luan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants