milvus-sdk-go icon indicating copy to clipboard operation
milvus-sdk-go copied to clipboard

[Bug]: Search with invalid annoy `search_k` gets nil error

Open ThreadDao opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

go version: master milvus version: master-20221208-6709ccf6

  1. milvus doc says about the valid annoy search_k: image

  2. Search with search_k := -2 also return search results, nil error

  3. Search with search_k := 9, which less than topK 20 also return results and nil error

  4. Search with search_k := 1000, which greater than topK(10)*n_trees(56) also return search results and nil error

Is the milvus annoy index document out of date?

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

ThreadDao avatar Dec 10 '22 10:12 ThreadDao

/assign @cqy123456

ThreadDao avatar Dec 10 '22 10:12 ThreadDao

/assign @cydrain

liliu-z avatar Dec 13 '22 10:12 liliu-z

I have checked the code, since Milvus 1.x, we have not limitation for the parameter "search_k". It's valid range scope is MIN_INT64 ~ MAX_INT64. Don't know where the doc coming from.

cydrain avatar Dec 13 '22 13:12 cydrain

I have checked ANNOY official website in github (https://github.com/spotify/annoy), the description for parameter "search_k" is as following:

Screenshot from 2022-12-13 21-29-27

So change "search_k" range scope to [k, MAX_INT64].

cydrain avatar Dec 13 '22 13:12 cydrain

fixed with https://github.com/milvus-io/knowhere/pull/601

cydrain avatar Dec 14 '22 02:12 cydrain

/assign @ThreadDao need to update test case

ThreadDao avatar Jan 30 '23 07:01 ThreadDao

/unassign

cqy123456 avatar Feb 06 '23 03:02 cqy123456