There is a table book which has the following definition. Book name will be stored in column name - attributes will be a map which will hold attributes such as authorname, yearofpublishing, etc.
CREATE TABLE book (
bookid uuid PRIMARY KEY,
createdat timestamp,
createdon timestamp,
description text,
attributes map<text, text>,
name text
) CREATE INDEX bookbyname ON project (name);
Question - A query should be developed to run from a generic search on the UI which will supply a string. That String should query [CONTAINS] on both the attributes column and name.
For Attributes, since it was a MAP, it supports CONTAINS keyword. However, how to do a CONTAINS query on index? In this case, bookbyname (name) field.
Cassandra does not support matching partial strings using the CONTAINS or LIKE operator. You should look into solutions such as Stargate or DSE that provide search functionality on top of Cassandra.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With