redis_hnsw icon indicating copy to clipboard operation
redis_hnsw copied to clipboard

Periods in a node's name cause search results to be truncated

Open ericlingit opened this issue 3 years ago • 0 comments

When a node's name contains a period (.), only the strings on the right-side of the period show up in the search result.

How to reproduce

  1. Create an index
    HNSW.NEW test DIM 3
    
  2. Add nodes
    HNSW.NODE.ADD test aaa.txt DATA 3 1.0 1.0 1.0
    HNSW.NODE.ADD test bbb.txt DATA 3 1.0 1.0 1.0
    HNSW.NODE.ADD test ccc.txt DATA 3 1.0 1.0 1.0
    
  3. Search
    HNSW.SEARCH test K 3 QUERY 3 1.0 1.0 1.0
    

Expected output

[
    3,
    ['similarity', '-0', 'name', 'aaa.txt'],
    ['similarity', '-0', 'name', 'bbb.txt'],
    ['similarity', '-0', 'name', 'ccc.txt']
]

Actual output

[
    3,
    ['similarity', '-0', 'name', 'txt'],
    ['similarity', '-0', 'name', 'txt'],
    ['similarity', '-0', 'name', 'txt']
]
  • Redis version: Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=636cde3b5c7a3923
  • libredis_hnsw.so version: v0.2.1

ericlingit avatar May 28 '21 03:05 ericlingit