milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
29.29k stars 2.81k forks source link

[Bug]: [restful v2] search api doesn't work well with searchParams #34105

Closed wwli05 closed 1 week ago

wwli05 commented 2 months ago

Is there an existing issue for this?

Environment

- Milvus version:2.3.17
- Deployment mode(standalone or cluster):cluster
- MQ type(rocksmq, pulsar or kafka): pulsar
- SDK version(e.g. pymilvus v2.0.0rc2): restful v2
- OS(Ubuntu or CentOS): ubuntu
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

1.in code [internal/distributed/proxy/httpserver/handler_v2.go], SearchReqV2 struct contains filed [params] , but in restful v2 tutorial section it declares [searchParams] which does not seem match; 2.if i want to declare special param just like [nprobe](FOR IVF_FLAT index) in [params], it does not take effect when i follows the next code in [handler_v2.go]

Expected Behavior

when I declare special search param, it takes effect so that I can take controll of various query params.

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

yanliang567 commented 2 months ago

please try the code snippet below, or share some code for reproduction

search_params = {
    "metric_type": "IP",
    "params": {"nprob": 128}
}

# Search with limit
res = client.search(
    collection_name="test_collection",
    data=data,
    limit=3,
    search_params=search_params
)

/assign @wwli05 /unassign

wwli05 commented 2 months ago

pls check below code curl --location --request POST "http://${}/v2/vectordb/entities/search" \ --header "" \ --data-raw '{ "collectionName":"", "data": [], "annsField": "vector", "searchParams": [ "metricType":"IP", "params":{ "nprobe":16 ---we adjust this value, but the performance has no impact, it seems this param does not take effect in Rest V2 ] }'

xiaofan-luan commented 2 months ago

/assign @PowderLi can you check on that?

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.

wwli05 commented 2 weeks ago

/reopen

sre-ci-robot commented 2 weeks ago

@wwli05: Reopened this issue.

In response to [this](https://github.com/milvus-io/milvus/issues/34105#issuecomment-2301294321): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.