为什么我的Cassandra Lucene索引从2个查询返回的结果较少/没有?

为什么我的Cassandra Lucene索引从2个查询返回的结果较少/没有?,cassandra,lucene,Cassandra,Lucene,由于我经常遇到下面描述的这个问题,我想改变,但缺少更好的选择 我有两个查询应该返回相同的结果。但是第二个查询返回的结果要少得多,有时甚至没有结果。以下是两个问题: SELECT * FROM statistics WHERE source = 'toutiao' AND timespan = '3'; SELECT * FROM statistics WHERE source = 'toutiao' AND timespan = '3' AND text = '{ sort: {fields

由于我经常遇到下面描述的这个问题,我想改变,但缺少更好的选择

我有两个查询应该返回相同的结果。但是第二个查询返回的结果要少得多,有时甚至没有结果。以下是两个问题:

SELECT * FROM statistics WHERE source = 'toutiao' AND timespan = '3';
SELECT * FROM statistics WHERE source = 'toutiao' AND timespan = '3'   AND text = '{ sort: {fields: [{field: "speed", reverse: true}]}}';.
我使用这个自定义卡桑德拉索引

我使用Cassandra 2.2.4.1 Cassandra lucene索引2.2.4

“text”是我在其上构建索引的表列

我的索引创建查询是:

CREATE CUSTOM INDEX statistics_text_idx ON toutiao.statistics (text) USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = {'schema': '{
        fields : {
            title: {
                                type : "text", analyzer : "english"},
                                category : {type:"string"},
                genre : {type:"string"},
                speed  : {type : "integer",sorted : true}
        }
}', '
        refresh_seconds': '1'};
表创建查询:

DROP TABLE IF EXISTS statistics;
CREATE TABLE statistics (
source text,
timespan text,
id text,
title text,
thumbnail text,
url text,
text text,
created_at timestamp,
category text,
category2 text,
genre text,
author text,
reads int,
likes int,
comments int,
shares int,
speed int,
PRIMARY KEY (source, timespan, id)
)WITH CLUSTERING ORDER BY (timespan DESC) AND caching = '{"keys":"ALL", "rows_per_partition":"ALL"}';
这是我的数据插入程序:

cluster = Cluster(['localhost'])
session_statis = cluster.connect(keyspace)
session_statis.execute('INSERT INTO tablename(col1,col2,col3,col4,col5,col6,col7,col8,col9,col10,col11,col12,col13,col14,col15) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', (value1,value2,value3,value4,value5,value6,value7,value8,value9,value10,value11,value12,value13,value14,value15))

谢谢你的帮助

如何插入数据?我也有同样的问题,结果是因为SSTableloader@Will我在上面的帖子中添加了我的数据插入程序。你的解决方案是什么?谢谢