Hi,
I’ve got a couple of questions.
-
Let’s say I have an index with a single tag field (separator ‘;’) and I created a document with id: “test” with tags “tag1;tag2;tag3;tag4”. Can I add/remove the specific tag from tag field without knowing about other tags? For example, I want to remove “tag2” from the document mentioned before so then the value of tag field would look like this “tag1;tag3;tag4”.
-
Let’s say I want to build dine table reservation system where every table has its own timeline. I want to use redis only for future reservations and for checking availability for a table at a specific time. Any reservation would be stored in separate, more durable database to save memory. So I want only check availability to of specific table and use transactions to prevent parallel reservation requests. I was thinking about tag field which would store timestamps of reservations and then I could group available tables by for example restaurant_id with FT.AGGREGATE. Le’ts say that the user wants reservation for 5:00 PM and the duration of the reservation is 1 hour. Additionally let’s assume that the user can make reservations for 5:00 PM, 5:15 PM, 5:30 PM, etc. so minimum 15min. Then query would look like this “-@tags:{timestamp of 5:00 PM} -@tags:{timestamp of 5:15 PM} -@tags:{timestamp of 5:30 PM} -@tags:{timestamp of 5:45 PM}”. That is my approach. Is it possible to model it in a different way (maybe more performant and without FT.AGGREGATE)"
-
Referring to the previous question, is it good approach of using FT.AGGREGATE considering later scalability? Query in the previous question is much simpler than the final one that would work for my domain problem.
-
Redisearch have ToList reducer for FT.AGGREGATE command. I want to group tables by restaurant_id and then get some fields from tables documents. Can I somehow retrieve more than one field with ToList? I tried to use couple of ToList reducers where each one retrieves a different field but I’m not sure that are they all in same order.
For example:
-
- “restaurant_id”
- “c0124d5b-c2dd-11ea-817b-bcee7b9d9a5d”
- “tables”
-
- “testTable3”
- “testTable2”
- “testTable”
- “table_reservations”
-
- “t1;t2”
- “t1;t2;t3;t4”
- “t1;t2;t3;t4;t5;t6”
Is table “testTable3” corresponding to table_reservations “t1;t2” or is it just coincidence that they match?
- Is it possible to add a new field to index and then remove it? The dropped field from the index in all documents can be deleted in my case. Is it possible to approach this in a different way if dropping field from the index isn’t possible?
Thank you in advance for your answers.
Regards