我使用DataStax Enterprise 3.2。在http://www.datastax.com/docs/datastax_enterprise3.0/solutions/dse_search_load_data
上运行示例时步骤2中有错误,插入值键应为字符串,' 123'。
一切正常,直到第8步。当我跑步时,
curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=mykeyspace.mysolr"
我收到了错误,
<lst name="responseHeader"><int name="status">500</int><int name="QTime">229</int></lst><lst name="error"><str name="msg">Unable to create core: mykeyspace.mysolr</str><str name="trace">org.apache.solr.common.SolrException: Unable to create core: mykeyspace.mysolr
....
....
Caused by: java.lang.IllegalStateException: Mismatch between Solr key field id with type text{class=org.apache.solr.schema.TextField,analyzer=org.apache.solr.analysis.TokenizerChain,args={class=solr.TextField}} and Cassandra key alias key with type text
at com.datastax.bdp.search.solr.core.Cql3CassandraSolrSchemaUpdater.validateUniqueKeyStructure(Cql3CassandraSolrSchemaUpdater.java:226)
at com.datastax.bdp.search.solr.core.Cql3CassandraSolrSchemaUpdater.update(Cql3CassandraSolrSchemaUpdater.java:39)
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:282)
... 29 more
我错过了一些配置吗?感谢。
答案 0 :(得分:1)
Solr&#34; text&#34; (solr.TextField)类型是真正的标记化文本,对于一系列标记没有唯一的,唯一的值,而Cassandra&#34; text&#34; type对应于单值Solr&#34; string&#34; (solr.StrField)类型。
此例外警告您应该使用Solr&#34;字符串&#34;输入类型以匹配Cassandra&#34; text&#34;类型。
我刚刚查看了您提供的文档链接,我确实看到了&#34; id&#34;字段有类型&#34;字符串&#34;。您是否手动输入了错误的类型,如&#34; text&#34;而不是&#34;字符串&#34;?