2014-12-27 59 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