Skip to content

FT.SEARCH Query syntax error with ? #4999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
finalgamer opened this issue Apr 25, 2025 · 1 comment
Open

FT.SEARCH Query syntax error with ? #4999

finalgamer opened this issue Apr 25, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@finalgamer
Copy link

finalgamer commented Apr 25, 2025

Describe the bug
When a tag field match contains a ? there is always a ERR Query syntax error response.

This seems to currently make it impossible to query a tag field that contains a ?

To Reproduce
Steps to reproduce the behavior:

// 1. Setup the index
FT.CREATE demo_idx ON HASH PREFIX 1 doc: SCHEMA tags TAG 

// 2. Add some documents (optional)
HSET doc:1 name "First Item" tags "?first"
HSET doc:2 name "Second Item" tags "?second"
HSET doc:3 name "Third Item" tags "?third"

// 3. Execute the query
FT.SEARCH demo_idx "@tags:{\\\?second}" // ERR Query syntax error
FT.SEARCH demo_idx "@tags:{\\?second}" // ERR Query syntax error
FT.SEARCH demo_idx "@tags:{\?second}" // ERR Query syntax error
FT.SEARCH demo_idx "@tags:{?second}" // ERR Query syntax error

Expected behavior

The query should not result in an error at least when the ? is properly escaped with \\?

FT.SEARCH demo_idx "@tags:{\\\?second}" // Returns result on redis-search
FT.SEARCH demo_idx "@tags:{\\?second}" // Returns result on redis-search
FT.SEARCH demo_idx "@tags:{\?second}" // Returns empty result on redis-search
FT.SEARCH demo_idx "@tags:{?second}" // Returns empty result on redis-search

Environment (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Kernel: 5.15.167.4-microsoft-standard-WSL2
  • Containerized?: yes Docker
    docker run -p 6667:6379 docker.dragonflydb.io/dragonflydb/dragonfly:v1.29.0
  • Dragonfly Version: 1.29.0

Reproducible Code Snippet

See above.

@finalgamer finalgamer added the bug Something isn't working label Apr 25, 2025
@vyavdoshenko
Copy link
Contributor

@finalgamer
Thanks for reporting the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants