0

How to write the like query in cassandra.

select * from user where user_name like '%abcd%'

How to write it into CQL(Cassandra query language)

Because i have to search some content base on keyword.

Aaron
  • 55,518
  • 11
  • 116
  • 132
user3359503
  • 31
  • 1
  • 7
  • 2
    As far as i know cassandra does not support like query operation. Because we have to query from more node so it maily suport EQ or IN on index columns family. – Bharat karotra Jun 09 '14 at 11:57
  • I have required search on the keyword. If you have know about this please help me – user3359503 Jun 09 '14 at 12:27
  • Use elastic search or Apache solr with cassandra. This are best tool for real time keyword search with long string or text. – Bharat karotra Jun 09 '14 at 15:04

1 Answers1

0

If it doesn't need to be real-time, you could use Hive or Shark. This enables you to run exactly the query you're speaking about. If you use DSE it works out of the box with Hive. If not, you'll want to check out this Hive driver.

To get this working with open source Cassandra, you'll need:

  1. HDFS running co-located with your Cassandra nodes
  2. If you use Spark, you'll need Spark workers (ideally co-located as well, though this isn't a hard requirement)
  3. Hive or Shark running on a machine that can access the cluster
rs_atl
  • 8,935
  • 1
  • 23
  • 28