Have a look at this link:
https://www.datastax.com/dev/blog/allow-filtering-explained-2
The ALLOW FILTERING
option allows you tell Cassandra that it is ok to perform in-memory filtering of the data once it loads rows from disk. So we can use this to search by a clustering column without specifying the previous clustering columns. But we can't use it on non-clustering columns.
See the below example schema from the blog. Use of ALLOW FILTERING
doesn't allow us to filter by author column until we make it an index, which then doesn't need the ALLOW FILTERING
option.
cqlsh:test> SELECT * FROM blogs WHERE author = 'john' ALLOW FILTERING;
Bad Request: No indexed columns present in by-columns clause with Equal operator
cqlsh:test>
cqlsh:test> CREATE INDEX authors ON blogs (author);
cqlsh:test> SELECT * FROM blogs WHERE author = 'john';
(0 rows)
cqlsh:test> SELECT * FROM blogs WHERE author = 'john' ALLOW FILTERING;
(0 rows)