Synonym groups search using RediSearch

Hello all,

I am having a hard time with the synonym groups of the RedisSearch module. I would like to retrieve a name using FT.SEARCH using a synonyms group.

What I am doing is the following:

        FT.CREATE test SCHEMA name TEXT SORTABLE

        FT.SYNADD test WORD EXAMPLE

        FT.ADD test I00001 1.0 FIELDS name "WORD"

        FT.SEARCH test EXAMPLE

With this code, I would expect to get the result ‘WORD’ from the last FT.SEARH clause, but I am getting none.

Should I change something in the order of the statements, or is it something else I am doing wrong?

Any help is much appreciated,

Thank you in advance.

We have a known issue that synonyms need to be added with lower case, we fixed this on master and this fix will be part of version 2.0. Until then, try it this way:

127.0.0.1:6379> FT.CREATE test SCHEMA name TEXT SORTABLE
OK
127.0.0.1:6379> FT.SYNADD test word example
(integer) 0
127.0.0.1:6379> FT.ADD test I00001 1.0 FIELDS name “WORD”
OK
127.0.0.1:6379> FT.SEARCH test EXAMPLE

  1. (integer) 1
  2. “I00001”
    1. “name”
    2. “WORD”
1 Like

Thank you very much!

I was not aware of the lower case issue. That was very helpful!

1 Like