First time using Redis

Hello,

Recently me and my colleagues have decided to try RediSearch for our development, and we were really impressed by the performance.

However, we have several questions regarding the usage of the API, we hoped you could answer.

  1. From some tests on the API, we found that if we search on a certain column, an expression that contains one word, for instance: “hello”, the results could contain extra results, that aren’t equal “hello”,

For instance, “hello world” could be part of the results.

We were wondering, is there is a way to ask the API for find the exact word? Attempting to send “hello” did not work either.

Moreover, it seems like it works only when you complete the first word, if I were to send hell results wouldn’t be find (unless hell ) is an actual value in for the column.

  1. We saw it is possible to search for by a prefix, e.g. @column: hell* would work.

But we were wondering if there is a way to also search by a suffix, e.g. @column: *old , to find all the results that end with the expression “old” , or even @column. elo to find all the results that contain the expression: elo

  1. We were wondering if there is an easy way to get all the possible values for each column, even on large databases.

@natalie_kirillov

Regarding your first issue, I assume for this field are you always going to perform exact match. in that case TAG would be right data type you can choose.

>> FT.CREATE roles SCHEMA id NUMERIC name TAG SORTABLE
"OK"

>> FT.ADD roles 1 1.0 FIELDS name "Software developer"
"OK"

>> FT.ADD roles 2 1.0 FIELDS name "Developer"
"OK"

>> FT.ADD roles 3 1.0 FIELDS name "PHP developer"
"OK"

>> FT.ADD roles 4 1.0 FIELDS name "Java developer"
"OK"

>> FT.SEARCH roles "@name:{developer}"
1) (integer) 1 2) "2" 3) 1) "name" 2) "Developer"

>> FT.SEARCH roles "@name:{Developer}"
1) (integer) 1 2) "2" 3) 1) "name" 2) "Developer"

>> FT.SEARCH roles "@name:{PHP}"
1) (integer) 0

>> FT.SEARCH roles "@name:{PHP developer}"
1) (integer) 1 2) "3" 3) 1) "name" 2) "PHP developer" 

Note here that:

  • partial match will not be supported if use TAG
  • its case insensitive

IF YOU ARE STARTING TO USE THE REDIS MODULES MY PERSONAL RECOMMENDATION IS TO INSTRUCT THEMSELVES WITH THE DOCUMENTATION OF THE BASIC CONCEPTS AND SIMPLE COMMANDS SO THAT YOU WILL HAVE AN IDEA OF HOW REDIS WORKS, YOU HAVE TO START KNOWING THE MOST BASIC AS FOR EXAMPLE:

WHAT IS REDIS ?, IT MAY SEEM SOMETHING FOOLISH BUT IF THE CONCEPT IS NOT CLEAR AS YOU ADVANCE, YOU MAY HAVE DOUBTS ABOUT HOW TO CORRECTLY USE ITS MODULES AND COMMANDS.

AS WE ALL KNOW, REDIS IS NOT A STORE OF VALUES-SIMPLE KEY, IT HAS BEEN A SERVER OF DATA STRUCTURES THAT ADMITS DIFFERENT TYPES OF SECURITIES.

OTHER OF THE FUNDAMENTAL POINTS THAT WE SHOULD KNOW ARE THE DIFFERENT TYPES OF STRUCTURES THAT ARE COMPATIBLE WITH REDIS:

-Binary-safe strings.
-Lists
-Sets
-Sorted sets
-Hashes
-Bit arrays
-HyperLogLogs
-Streams

WHEN THIS IS UNDERSTOOD THE BEST POSSIBLE, YOU CAN START USING THE REDIS MODULES AS:

-REDISBLOOM
-REDISJSON
-REDISTIMESERIES

@Kendrick

Thanks for your suggestion to community - new redis geeks.

you can always follow this redis forum for any help and guidance, to learn basic Redis data structures and commands you can always visit:
http://redis.io/

then to learn about Redis modules go the respective documentation sites:

And Enroll for Redis University course (FREE self spaced Redis topics):

Hope this helps.

Yes - take a look at a lot of the videos as they explain things in an accessible way. I also found this thread: Redis University Videos - Redis Explained: Learn Redis to be useful in expanding the knowledge base.