Skip to content

Protocol issue: Syntax error at offsetΒ #69

@marcing

Description

@marcing

Dear Alex,

Great job on the redis client!
Today I was connecting to RediSearch and I think I might have found a small issue.
For a case such as this one, where double quotes are used:

->executeRaw(['FT.SEARCH', 'index', '@location:"not far"'])

A following situation happens:

RedisClient\Exception\ErrorResponseException: Syntax error at offset 11 near not in ...

redis monitor is reporting a following command:

"FT.SEARCH" "index" "'@location:\"not far\"'"

However I am not sure if it's escape related, or is it just the double quote character.
It is the recommended syntax:
https://oss.redislabs.com/redisearch/Query_Syntax.html
See "Exact phrases are wrapped in quotes, e.g "hello world"".

When running the same command directly, the syntax issue does not occur:

127.0.0.1:6379> FT.SEARCH index @location:"not far"
1) (integer) 1
2) "15cc84e0485468"
3)  1) news_id
    2) "19734"
    3) provider
    4) "Marcin"
....

I applied a temporary workaround - single quotes instead of double quotes, which seems to work fine.
Sadly I was not able to identify a place in the code, which might be the reason for this behaviour. I hope you will be able to.

Thank you!
Marcin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions