【问题标题】:Error creating search index in SolR - Cassandra integration (DSE)在 SolR 中创建搜索索引时出错 - Cassandra 集成 (DSE)
【发布时间】:2017-11-25 01:13:32
【问题描述】:

我在 DSE cassandra 实例中有一个包含以下字段的表,

customerid uuid,
emailaddress text,
firstname text,
lastname text
PRIMARY KEY is on (customerid, emailaddress)

我已将 schema.xml 定义如下,

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="customer" version="1.5">
<types>
        <fieldType class="org.apache.solr.schema.TextField" name="TextField">
                <analyzer>
                        <tokenizer class="solr.StandardTokenizerFactory"/>
                        <filter class="solr.LowerCaseFilterFactory"/>
                </analyzer>
        </fieldType>
        <fieldType class="solr.StrField" name="StrField"/>
        <fieldType class="solr.TrieIntField" name="int"/>
        <fieldType class="solr.UUIDField" name="uuid"/>
</types>
<fields>
        <field indexed="true" multiValued="false" name="emailaddress" stored="true" type="TextField"/>
        <field indexed="true" multiValued="false" name="customerid" stored="true" type="uuid"/>
        <field indexed="true" multiValued="false" name="lastname" stored="true" type="TextField"/>
</fields>
<uniqueKey>customerid</uniqueKey>
</schema>

尝试在命令行上创建核心时出现以下异常,

$ curl -u db_admin:test123 "http://localhost:8983/solr/admin/cores?action=CREATE&name=ks_01.customer"

"...<str name="msg">com.datastax.bdp.search.solr.CassandraIndexSchema$ValidationException: Clustering parts that are not part of the unique key must be multi-valued.</str><str name="trace">org.apache.solr.common.SolrException: com.datastax.bdp.search.solr.CassandraIndexSchema$ValidationException: Clustering parts that are not part of the unique key must be multi-valued....."

有人可以通过一些详细的解释来建议我在这里缺少什么。谢谢。

【问题讨论】:

    标签: solr cassandra datastax datastax-enterprise


    【解决方案1】:

    我对 DSE 一无所知,但在我看来您犯了语法错误[1]:

    <uniqueKey>customerid</uniqueKey> 
    

    应该是

    <uniqueKey>(customerid, emailaddress)</uniqueKey>
    

    [1]http://docs.datastax.com/en/datastax_enterprise/4.8/datastax_enterprise/srch/srchConfSkema.html

    【讨论】:

      猜你喜欢
      • 2020-09-18
      • 2016-05-20
      • 2020-12-20
      • 2013-09-30
      • 2020-07-28
      • 1970-01-01
      • 2020-08-16
      • 1970-01-01
      • 2014-12-12
      相关资源
      最近更新 更多