Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ftSearch does not work with wildcard search #61

@adamzrk

Description

@adamzrk

This query:
ft.search json:search "@field: w'fulltext*5d13e891162a456babf2fd9b864df96d'" DIALECT 2
when executed in redis-cli returns correct data.
According to https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/:
"In DIALECT 2 or greater, wildcard pattern matches are expressed as "w'foobar?'". Note the use of double quotes to contain the w pattern."
Double quotes are required so I try to add them to the query at the begging and the end of the query:
query.append(String.format("\"@field: w'%s", text) .append("*").append(role).append("'\""));
but when running:
`connection.sync().ftSearch("json:search" query);

the following error is returned:
io.lettuce.core.RedisCommandExecutionException: Syntax error at offset 1 near text
lettucemod version 3.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions