2014-12-27 62 views
0

运行Datastax工具上DataStax Enterprise Server 4.6.0 从头从现有的表Datastax dsetool Solr的create_core失败TIMEUUID

dsetool create_core ks.table generateResources=true distributed=true reindex=true 

org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: 

    Type org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType) 

is not supported with automatic Solr schema generation. 

产生的Solr根据这一http://www.datastax.com/documentation/datastax_enterprise/4.5/datastax_enterprise/srch/srchSolrType.html,Solr的支持UUID和timeuuid as of 4.5

建议?

回答

1

由于Solr的默认不承认timeuuid,我们需要创建Schema.xml文件手动看起来像这样

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<schema name="autoSolrSchema" version="1.5"> 
<types> 
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/> 
<fieldType class="org.apache.solr.schema.UUIDField" name="UUIDField"/> 
<fieldType class="org.apache.solr.schema.TextField" name="TextField"> 
<analyzer> 
<tokenizer class="solr.StandardTokenizerFactory"/> 
<filter class="solr.LowerCaseFilterFactory"/> 
</analyzer> 
</fieldType> 
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/> 
</types> 
<fields> 
<field indexed="true" multiValued="false" name="article_url" stored="true" type="StrField"/> 
<field indexed="true" multiValued="false" name="articleid" stored="true" type="UUIDField"/> 
<field indexed="true" multiValued="false" name="article_title" stored="true" type="StrField"/> 
<field indexed="true" multiValued="false" name="image" stored="true" type="StrField"/> 
<field indexed="true" multiValued="false" name="history" stored="true" type="UUIDField"/> 
</fields> 
<uniqueKey>(articleid)</uniqueKey> 
</schema> 

然后定义timeuuid字段作为UUIDField,看到history

运行

dsetool create_core kular.articles schema=/home/ubuntu/articles_schema.xml generateResources=true distributed=true reindex=true

+2

仅供参考,这只是一个问题,当你有timeuuid聚类列与DESC聚类顺序。应在未来版本中解决。 – phact 2014-12-29 17:01:18