Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra full text search like

Let's say I have a column family named Questions like below: Questions = {
Who are you: { username: "user1" }, What is the answer: { username: "user1" }... }

How do I search for all the questions that contain certain words? Get all questions that contain 'what' word. How do I do it using python or at least Java?

like image 309
user75569 Avatar asked Jun 30 '10 20:06

user75569


2 Answers

Solandra (https://github.com/tjake/Solandra) is the new name for Lucandra.

Solandra is a combination of Cassandra and Solr (which is based on the Lucene full-text search engine).

Cassandra alone doesn't tackle text-search, although you could implement some basic text indexing by creating secondary index column families (Google: cassandra secondary index).

like image 162
DNA Avatar answered Nov 15 '22 09:11

DNA


I'm new to Cassandra, but querying in it is relatively limited, compared to, for instance, a relational database. (This is by design.) I'm pretty sure there's no support for full text search at this time (this may not even be on the roadmap).

You might be best to go with Lucene or something comparable to index the text of the questions, either within the Cassandra datastore or in a separate datastore.

  • http://lucene.apache.org/java/docs/index.html

There appears to be at least one project that is attempting to integrate Lucene with Cassandra, and there may be others:

  • http://github.com/tjake/Lucandra

Another way to go in your case might be to break up the questions into words and maintain your own index of words to questions; your mileage may vary here, and something like Lucene will no doubt give you greater flexibility in querying.

like image 43
Eric Walker Avatar answered Nov 15 '22 09:11

Eric Walker