首页 文章

使用Solr集成时,DSE创建的Cassandra索引的性质是什么?

提问于
浏览
2

使用DSE软件将Solr与Cassandra集成时,为列族添加Solr核心会在Solr架构中索引的所有顶级字段上创建索引 . 使用示例CF和Solr架构概述了here,生成了一堆索引:

cassandra@cqlsh:demo1> desc demo;

CREATE TABLE demo1.demo (
    id text PRIMARY KEY,
    friends list<frozen<name>>,
    magic_numbers frozen<tuple<int, int, int>>,
    name frozen<name>,
    solr_query text,
    status text
[skipped]
CREATE CUSTOM INDEX demo1_demo_friends_index ON demo1.demo (friends) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';
CREATE CUSTOM INDEX demo1_demo_magic_numbers_index ON demo1.demo (magic_numbers) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';
CREATE CUSTOM INDEX demo1_demo_name_index ON demo1.demo (name) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';
CREATE CUSTOM INDEX demo1_demo_solr_query_index ON demo1.demo (solr_query) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';
CREATE CUSTOM INDEX demo1_demo_status_index ON demo1.demo (status) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';

我想要理解的是这些索引是否只是真正的Solr索引,而且只是在Cassandra输出中"show up"因为有一些正在进行的集成,或者它们实际上是"full Cassandra indexes"(因为缺少更好的名称,但我是谈论我可以使用 CREATE INDEX CQL语句创建的索引 . 关注的是如果它们是Cassandra索引,那么它们将产生性能问题,因为相应的数据可能具有高基数 .

如果它们不是“完整的Cassandra索引”,那么我想知道为什么在冻结字段上创建Solr核心存在问题 . 即如果我创建一个列系列:

cassandra@cqlsh:demo1> CREATE TABLE demo2 ( 
  "id" VARCHAR PRIMARY KEY, 
  "name" frozen<Name>, 
 "friends" frozen<list<Name>> );

Solr核心创建( dsetool create_core ,带 generateResources=true )失败:

WARN  [demo1.demo2 Index WorkPool scheduler thread-0] 2016-02-09 13:57:14,781  WorkPool.java:672 - Listener com.datastax.bdp.search.solr.AbstractSolrSecondaryIndex$SSIIndexPoolListener@69442bb
6 failed for pool demo1.demo2 Index with exception: SolrCore 'demo1.demo2' is not available due to init failure: org.apache.cassandra.exceptions.InvalidRequestException: Frozen collections cur
rently only support full-collection indexes. For example, 'CREATE INDEX ON <table>(full(<columnName>))'.
org.apache.solr.common.SolrException: SolrCore 'demo1.demo2' is not available due to init failure: org.apache.cassandra.exceptions.InvalidRequestException: Frozen collections currently only su
pport full-collection indexes. For example, 'CREATE INDEX ON <table>(full(<columnName>))'.
        at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:742) ~[solr-uber-with-auth_2.0-4.10.3.1.287.jar:4.10.3.1.287]
        at com.datastax.bdp.search.solr.core.CassandraCoreContainer.getCore(CassandraCoreContainer.java:171) ~[dse-search-4.8.4.jar:4.8.4]
        at com.datastax.bdp.search.solr.AbstractSolrSecondaryIndex.getCore(AbstractSolrSecondaryIndex.java:546) ~[dse-search-4.8.4.jar:4.8.4]
        at com.datastax.bdp.search.solr.AbstractSolrSecondaryIndex$SSIIndexPoolListener.onBackPressure(AbstractSolrSecondaryIndex.java:1467) ~[dse-search-4.8.4.jar:4.8.4]

(当然,这可以很好地遵循博客中使用冻结字段列表的示例,而不是冻结字段列表) .

1 回答

  • 4

    我想了解的是这些索引是否只是真正的Solr索引,而只是在Cassandra输出中“显示”,因为存在一些正在进行的集成,或者它们实际上是“完整的Cassandra索引”

    DSE搜索索引使用您的问题中提到的Cassandra 's secondary index API to provide a bridge between the Cassandra write path and the Solr document update machinery. They are not 1237232 in the sense you' ve,即使您在表描述中看到多个索引条目 . 这些条目中的每一个表示同一Solr核心中的单个索引字段 .

    我想知道为什么在冻结字段上创建Solr核心存在问题 .

    您是否能够按照您提到的_1237234完成,或者您是否也在那里观察到错误?如果您可以无误地跟踪它,也许我们可以使用它作为基线来隔离您的问题 . (我'm assuming you'已使用 dsetool create_coregenerateResources=true 来创建有问题的核心 . )

相关问题