Search for wildcards in the cassandra database

I want to know if there is a way to do a wildcard search in the cassandra database. eg.

select KEY,username,password from User where username='\*hello*'; 

or

 select KEY,username,password from User where username='%hello%'; 

something like that.

+6
source share
2 answers

Cassandra does not have its own ways of executing such queries. Typical options for achieving the same are

a) Observe the index yourself on likely search terms. For example, whenever you insert a record that has a greeting in the username, insert a record in the index column family with a greeting as the key and a column value as the key for your data entry. When prompted, query for the CF index, and then extract data from your CF data. Of course, this is quite restrictive, but may be useful for some basic needs.

b) It is best to use a full-text search engine. Take a look at Solandra, https://github.com/tjake/Solandra or Datastax http://www.datastax.com/products/enterprise

+4
source

This project also looks promising http://tuplejump.imtqy.com/stargate/

I have not looked at him lately, but when I last evaluated him, he looked promising.

0
source

Source: https://habr.com/ru/post/921453/


All Articles