Solr “聚类列”;“地位”;无法限制(前一列“datetime”受非EQ关系限制
我的datetime列仅用于排序,其余的集群键用于筛选。但如果不给datetime赋予同等的值,我无法按其他列进行筛选。如果我使用Apache solr,我可以解决我的问题吗 我的桌子:Solr “聚类列”;“地位”;无法限制(前一列“datetime”受非EQ关系限制,solr,cassandra,datastax,Solr,Cassandra,Datastax,我的datetime列仅用于排序,其余的集群键用于筛选。但如果不给datetime赋予同等的值,我无法按其他列进行筛选。如果我使用Apache solr,我可以解决我的问题吗 我的桌子: create table search_by_company_id_status ( agency_id text, datetime timestamp, createid text, status text, primary key ((agency_id),datetime,status
create table search_by_company_id_status
(
agency_id text,
datetime timestamp,
createid text,
status text,
primary key ((agency_id),datetime,status,createid)) with clustering order by (datetime desc);
我正在尝试的问题:
select * from search_by_agency_id_status where agency_id='125' and datetime>'2018-02-02 12:00:00.000' and recordstatus='7' and createid='id234';
根据您提供的查询,您正在使用“等于”谓词过滤其余集群列,即“status”和“createdid” 您可以按如下方式重新设计该表,以保证datetime上的排序顺序(因为之前的每个值都会针对单个值进行筛选) 这个查询应该可以正常工作
select * from search_by_agency_id_status where agency_id='125' and status='7' and createid='id234' and datetime>'2018-02-02 12:00:00.000';
我没有这么做,因为我不总是按状态和createid筛选,这两列只是可选的。我想我必须再创建两个表来满足筛选。谢谢回答。
select * from search_by_agency_id_status where agency_id='125' and status='7' and createid='id234' and datetime>'2018-02-02 12:00:00.000';