Search code examples
redisredisearch

Searching 3 words in TAGS Redis?


Im using a simple redis query searching on tags but for some reason when you introduce 3 words it doesn't work? is there a way around this? any other combination less than 3 is fine.

FT.SEARCH idx:content:details "@deleted:0 @contentAlias:{Games}" - works

FT.SEARCH idx:content:details "@deleted:0 @contentAlias:{Games and Drills}" - doesnt work

Solution

  • TAGS in RediSearch can be impacted by stop words—i.e. really common words in English that aren't useful for searching. Like 'the', 'is', and 'and'—which you have in your query.

    You need to escape the spaces in your query with a backslash. However, the backslash itself will also need escaped. Try this:

    FT.SEARCH idx:content:details "@deleted:0 @contentAlias:{Games\\ and\\ Drills}"