Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started



mailforlalit avatar image
mailforlalit asked Erick Ramirez answered

How do I model tables for multi-criteria search functionality in the application?

Using the Search Feature scenario, I would like to get opinion to design/implement search functionality.

For Example :

An Employee data stored in the table.. I would like to search employee for one or many combination of search criteria of attributes of Employees.

  • Name
  • Department
  • Joining Date
  • Active Employee

and many more other criteria.

On screen I can give values for either of these or all criteria.

How should we proceed to implement this scenario specially table design. I am not sure if we need to create tables for all possible combination of these criteria ( keeping as partition and cluster keys).

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

The current version of Apache Cassandra does not provide this functionality unless you index multiple columns in a table but there can be performance implications to doing that and won't necessarily achieve the outcome you're after.

It sounds like what you really need is a free-form text search functionality with Apache Solr. Solr can do free-form searches on your data using Lucene indexes.

You can integrate Solr/Lucene with Cassandra yourself. But if you're looking for an out-of-the-box solution, DataStax Enterprise includes DSE Search that allows you to do ad-hoc searches backed by Solr and Lucene. Cheers!

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.