私はcassandra 2.1.10を使用しています。 だから最初に私は私がセカンダリインデックスを知っていることが明らかになり、私は次しようとしていたテストの目的のためにcassandra.Butにおけるアンチパターンです:cassandraのセカンダリインデックスの範囲クエリ
CREATE TABLE test_topology1.tt (
a text PRIMARY KEY,
b timestamp
) WITH bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
CREATE INDEX idx_tt ON test_topology1.tt (b);
私は次のクエリを実行すると、それは私にエラーを与えます。
cqlsh:test_topology1> Select * from tt where b>='2016-04-29 18:00:00' ALLOW FILTERING;
InvalidRequest: code=2200 [Invalid query] message="No secondary indexes on the restricted columns support the provided operators: 'b >= <value>'"
このBlogはフィルタリングがセカンダリインデックスを照会するために使用することができ許すと言いながら。 CassandraはWindowsマシンにインストールされています。
あなたのものではないこの[スレッド](http://stackoverflow.com/questions/35718851/how-to-perform-query-with-cassandras-timestamp-column-as-where-condition)の2つの回答セカンダリインデックスで範囲クエリを実行できないことを説明します。また、参照している投稿では、セカンダリインデックスのクエリの> =制限はインデックスなしのカラムに対してのみ可能で、フィルタリングを許可する場合にのみ可能です。 – Ralf
@Ralf答えの1つは、フィルタリングを許可すると範囲クエリが可能になるということです。また、私が質問したcassandraのブログとこれはそうです投稿http://stackoverflow.com/questions/34540883/cassandra-range-search-on-secondary-index-with-allow-filtering同じことを提案 –