milvus-io / milvus

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

[Bug]: Binary search is failed when metric type is hamming in milvus-dev docker #18188

Closed nameczz closed 1 year ago

nameczz commented 2 years ago

Is there an existing issue for this?

Environment

- Milvus version:milvusdb/milvus-dev:master-latest 238d4d48b454
- Deployment mode(standalone or cluster):standalone
- SDK version(e.g. pymilvus v2.0.0rc2):node sdk
- OS(Ubuntu or CentOS): centos
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Search failed when binary search with metric type as Hamming. I also tried Jaccard, failed too

 const res = await milvusClient.dataManager.search({
      collection_name: COLLECTION_NAME,
      expr: '',
      vectors: [[4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3]],

      search_params: {
        anns_field: VECTOR_FIELD_NAME,
        topk: '4',
        metric_type: 'Hamming',
        params: JSON.stringify({ nprobe: 1024 }),
        round_decimal: -1,
      },
      vector_type: DataType.BinaryVector,
    });

      ----- Expr Vector Search  ----- {
        status: {
          error_code: 'UnexpectedError',
          reason: 'fail to search on all shard leaders, err=fail to Search, QueryNode ID=1, reason=stream operation failed: [UnexpectedError] Assert "binary search not support metric type: Hamming" at /go/src/github.com/milvus-io/milvus/internal/core/src/query/SearchBruteForce.cpp:61\n'
        },
        results: []
      }

Expected Behavior

Binary search success.

Steps To Reproduce

1. create collection
2. load collection
3. insert 100 data
4. flush
5. binary search

Milvus Log

   ----- Expr Vector Search  ----- {
        status: {
          error_code: 'UnexpectedError',
          reason: 'fail to search on all shard leaders, err=fail to Search, QueryNode ID=1, reason=stream operation failed: [UnexpectedError] Assert "binary search not support metric type: Hamming" at /go/src/github.com/milvus-io/milvus/internal/core/src/query/SearchBruteForce.cpp:61\n'
        },
        results: []
      }

Anything else?

No response

xiaofan-luan commented 2 years ago

/assign @cydrain

cydrain commented 2 years ago

This issue is because metric type string is case-sensitive, we need use "HAMMING" not "Haming".

18277 moves all brute force search logic to Knowhere, where metric type is case-insensitive.

When knowhere upgraded to v1.1.14 or higher, this issue can be closed.

cydrain commented 2 years ago

@yanliang567 knowhere-v1.2.0 has been merged into milvus, please verity this issue /assign @yanliang567 /unassign

yanliang567 commented 2 years ago

@nameczz could u please help to verify it on v2.1.2 or master? /assign @nameczz /unassign

stale[bot] commented 1 year 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.