0

search by character ordered by value Cassandra:

I am currently in the process of mastering cassandra with a first project. This one is a social network. I am working on the search bar to find users in the network. I'm looking for the best db organization as well as the best cql command to retrieve a list of 5 users starting from a score (float by descending order) as well as the first character of the pseudo of this one that the user entered. Here is my idea to organize the cassandra table

CREATE TABLE user_classement (id int, user_name set<text>, score float,PRIMARY KEY(id, score))WITH CLUSTERING ORDER BY (score DESC) ;
create index on user_classement  (user_name);

Here is my idea to organize the cassandra table

INSERT INTO user_classement(id, user_name, score) VALUES (678, {'j', 'je', 'jes', 'jesv', 'jesve'}, 89,6);

The problem is that this organisation is not at all optimised and does not work with a contains in the cql command

Jesver
  • 83
  • 1
  • 6

1 Answers1

0

It is not possible to achieve this with Cassandra. You can check out this post.

Wildcard search in cassandra database

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 30 '21 at 00:26