欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Caused by: org.apache.solr.common.SolrException: Invalid UUID String: '1'

程序员文章站 2022-03-03 21:36:37
...
问题:
引用
Caused by: org.apache.solr.common.SolrException: Invalid UUID String: '1'

参考:https://issues.apache.org/jira/browse/SOLR-3398
当使用
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
<field name="id" type="uuid" indexed="true" stored="true" required="true" multiValued="false" />

来自动生成ID时,出现下面错误:
org.apache.solr.core.CoreContainer; Error creating core [collection2]: Error initializing QueryElevationComponent.
org.apache.solr.common.SolrException: Error initializing QueryElevationComponent.
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:815)
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:658)
	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:637)
	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:381)
	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:375)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:148)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent.
	at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:254)
	at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:619)
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:795)
	... 9 more
Caused by: org.apache.solr.common.SolrException: Invalid UUID String: '1'
	at org.apache.solr.schema.UUIDField.toInternal(UUIDField.java:89)
	at org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:391)
	at org.apache.solr.handler.component.QueryElevationComponent$ElevationObj.<init>(QueryElevationComponent.java:150)
	at org.apache.solr.handler.component.QueryElevationComponent.loadElevationMap(QueryElevationComponent.java:323)
	at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:237)


解决方法:
把conf/elevatel.xml中的不需要的example删掉,改为自己需要的。

引用
It appears based on the bug report that you have modified the example solr schema.xml to change the uniqueKey field to use UUIDField - however you also seem to still have the QueryElevationComponent enabled in your solrconfig.xml file, configured to use the uniqueKey field, and the elevate.xml file has (example) entries referring to IDs which are not legal UUID values.

So you can either remove the QueryElevationComponent, or edit elevate.xml to remove the examples from elevate.xml, or change the QueryElevationComponent configuration in solrconfig.xml to use some lookup field other then the uniqueKey field.
相关标签: Solr