Skip to content

[BUG] Unable to use {USA|GBR|CAN} syntax for tag filter in KNN hybrid query #449

@zvi-code

Description

@zvi-code

Describe the bug:
According to documentation, filtering with syntax @country:{USA|GBR|CAN} should work for hybrid queries, but it does not.

Expected:
This is expected to work as an equivalent for an OR filter, e.g. (@country:{USA} | @country:{GBR} | @country:{CAN}).

Actual:
The query does not return results or is not accepted, while the equivalent OR filter in parentheses works as expected.

Example:
This works (returns results):

FT.SEARCH idx_hnsw_cosine '(@country:{USA} | @country:{GBR} | @country:{CAN})=>[KNN 5 @text_embedding_vector $query_vector]' PARAMS 2 query_vector $'...'

This does not work (no results or error):

FT.SEARCH vector_index_x '@country:{USA|GBR|CAN}=>[KNN 5 @text_embedding_vector $query_vector]' PARAMS 2 query_vector $'...'

Environment

  • Valkey Search Module Version: main branch (commit SHA 90124dc)
  • Valkey Core Version: build-debug (commit SHA if known)
  • OS: Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Unassigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions