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]: [restful v2] When nq > 1, search interface always return the result of the first vector #32837

Open
1 task done
yhmo opened this issue May 8, 2024 · 4 comments
Open
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@yhmo
Copy link
Contributor

yhmo commented May 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

When nq > 1, search interface always return the result of the first vector

Expected Behavior

No response

Steps To Reproduce

1. Create a collection and insert some data:
 pymilvus import (
    MilvusClient,
    connections,
    FieldSchema, CollectionSchema, DataType,
    Collection,
    utility,
)

connections.connect(host='localhost', port='19530')
print(utility.get_server_version())


collection_name = "AAA"
dim = 3
metric_type = "L2"

fields=[
    FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=True),
    FieldSchema(name="vector", dtype = DataType.FLOAT_VECTOR, dim=dim),
]

schema = CollectionSchema(fields=fields)

if utility.has_collection(collection_name):
    utility.drop_collection(collection_name)

collection = Collection(name=collection_name, schema=schema)
print(f"Collection '{collection_name}' created")


collection = Collection(collection_name)

batch_count = 1000
data = [
    [[10 * (k + d) / batch_count for d in range(dim)] for k in range(batch_count)],  # vector
]
ret = collection.insert(data)
print("insert done")

collection.flush()
print("flush done")

collection = Collection(collection_name)
index_params = {
    'metric_type': metric_type,
    'index_type': "FLAT",
    'params': {},
}
collection.create_index(field_name="vector", index_params=index_params)
print("index done")

collection = Collection(collection_name)

collection.load()

2. Search with restful v2, nq=2

curl --location --request POST "http://localhost:19530/v2/vectordb/entities/search"
--header "Content-Type: application/json"
--data-raw '{
"collectionName": "AAA",
"data": [
[0.3580376395471989, -0.6023495712049978, 0.18414012509913835],
[0.3, -0.4, 0.5]
],
"annsField": "vector",
"limit": 3
}'


It only returns the result of the first vector:

{"code":200,"data":[{"distance":0.53010494,"id":449612794136101426},{"distance":0.5322084,"id":449612794136101427},{"distance":0.5349118,"id":449612794136101428}]}

Milvus Log

No response

Anything else?

No response

@yhmo yhmo added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 8, 2024
@xiaofan-luan
Copy link
Contributor

/assign @PowderLi
could you help on investigating this?

@yanliang567
Copy link
Contributor

/unassign

@yanliang567 yanliang567 added this to the 2.4.2 milestone May 14, 2024
@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 14, 2024
@yanliang567 yanliang567 modified the milestones: 2.4.2, 2.4.3 May 24, 2024
sre-ci-robot pushed a commit that referenced this issue May 26, 2024
…3363)

issue: #33099 #32837 #32419
master pr: #33339

1. len(search result) may be nq * topk, we need return all rather than
topk
2. the  in restful response payload keep the same with milvus error code

Signed-off-by: PowderLi <min.li@zilliz.com>
@PowderLi PowderLi removed their assignment May 27, 2024
@PowderLi
Copy link
Contributor

/assign @yanliang567

sre-ci-robot pushed a commit that referenced this issue May 27, 2024
issue: #33099 #32837 #32419

1. len(search result) may be nq * topk, we need return all rather than
topk
2. the  in restful response payload keep the same with milvus error code

Signed-off-by: PowderLi <min.li@zilliz.com>
@yanliang567
Copy link
Contributor

/assign @zhuwenxing
please help to verify and check if it need more test to cover this scenario.

/unassign

@yanliang567 yanliang567 modified the milestones: 2.4.3, 2.4.4, 2.4.5 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants