hi, I am encountering an issue with Redis when using hash indexes (IndexType.HASH). I have created two hash indexes named "Testing_index_hnsw_FAY_m_500_construct_50000" and "Testing_index_hnsw_FAY_m_500_construct_50000_rm" on the same Redis instance within a Redis cluster. Each index has distinct fields and prefixes, yet I'm observing unexpected behavior where updating data in "Testing_index_hnsw_FAY_m_500_construct_50000_rm" seems to reflect on "Testing_index_hnsw_FAY_m_500_construct_50000".
Specifically, when I query FT.INFO Testing_index_hnsw_FAY_m_500_construct_50000, it shows a non-zero/the exact count of Testing_index_hnsw_FAY_m_500_construct_50000_rm documents, despite having no documents explicitly added to "Testing_index_hnsw_FAY_m_500_construct_50000". Furthermore, retrieving keys from "Testing_index_hnsw_FAY_m_500_construct_50000" returns zero keys.
Here's how I've defined the indexes: Testing_index_hnsw_FAY_m_500_construct_50000_rm: index_name = "Testing_index_hnsw_FAY_m_500_construct_50000_rm" title = TextField(name="title") text_embedding = VectorField("embeddings", "HNSW", { "TYPE": "FLOAT32", "DIM": VECTOR_DIM, "DISTANCE_METRIC": DISTANCE_METRIC, "M": 500, "EF_CONSTRUCTION": 50000 } ) url = TextField(name="url") part_id = NumericField(name="part_id") text = TextField(name="text") doc_type = TextField(name="doc_type") doc_id = TextField(name="doc_id")
fields = [title,text_embedding,url,part_id,text,doc_type,doc_id ]
master_cluster.ft(index_name).create_index(
fields = fields,
definition = IndexDefinition(prefix=["Testing_index_hnsw_FAY_m_500_construct_50000_rm"], index_type=IndexType.HASH)
)
Testing_index_hnsw_FAY_m_500_construct_50000: index_name = "Testing_index_hnsw_FAY_m_500_construct_50000" title = TextField(name="title") text_embedding = VectorField("embeddings", "HNSW", { "TYPE": "FLOAT32", "DIM": VECTOR_DIM, "DISTANCE_METRIC": DISTANCE_METRIC, "M": 500, "EF_CONSTRUCTION": 50000 } ) url = TextField(name="url") part_id = NumericField(name="part_id") text = TextField(name="text") doc_type = TextField(name="doc_type") doc_id = TextField(name="doc_id")
fields = [title,text_embedding,url,part_id,text,doc_type,doc_id ]
master_cluster.ft(index_name).create_index(
fields = fields,
definition = IndexDefinition(prefix=["Testing_index_hnsw_FAY_m_500_construct_50000"], index_type=IndexType.HASH)
)
here are some screenshot of FT.INFO:
Testing_index_hnsw_FAY_m_500_construct_50000:
Testing_index_hnsw_FAY_m_500_construct_50000_rm:
the reason for one document extra is that i am currently uploading data on index "Testing_index_hnsw_FAY_m_500_construct_50000_rm"
here is the screen shot of the length of keys in Testing_index_hnsw_FAY_m_500_construct_50000 index:
Could you please explain why updates to "Testing_index_hnsw_FAY_m_500_construct_50000_rm" appear to affect the document count in "Testing_index_hnsw_FAY_m_500_construct_50000", despite no explicit documents being added to "Testing_index_hnsw_FAY_m_500_construct_50000"? Both indexes are configured on the same Redis instance within a Redis cluster. also when i query on index "Testing_index_hnsw_FAY_m_500_construct_50000" it retrieve data from the documents of "Testing_index_hnsw_FAY_m_500_construct_50000_rm"
Thanks.
Comment From: sundb
@FAHADALIYOUSAF please report this issue in https://github.com/RediSearch/RediSearch/issues