11

声明

<field name="id" type="int" indexed="true" stored="true" required="true" 
 multiValued="false" />

导致schema.xml以下错误。

 HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure:     Error initializing QueryElevationComponent.,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Error initializing QueryElevationComponent. at 
    org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) at 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at 
java.lang.Thread.run(Thread.java:619) Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:835) at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:629) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:622) at 
org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) at 
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) at 
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at 
java.util.concurrent.FutureTask.run(FutureTask.java:138) at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at 
java.util.concurrent.FutureTask.run(FutureTask.java:138) 
... 3 more Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at 
org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:240) at 
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:601) at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:830) 
... 13 more Caused by: java.lang.NumberFormatException: For input string: "MA147LL/A" at
 java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at 
java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at 
org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:387) at 
org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:378) at 
org.apache.solr.handler.component.QueryElevationComponent$ElevationObj.<init>(QueryElevationComponent.java:136) at 
org.apache.solr.handler.component.QueryElevationComponent.loadElevationMap(QueryElevationComponent.java:309) at 
org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:223) ... 15 more ,code=500}

谁能告诉我为什么会这样?

4

2 回答 2

26

转到 elevate.xml @SOLR_HOME\example\example-DIH\solr\solr\conf

这样修改

<query text="ipod">
<!--   <doc id="MA147LL/A" />   put the actual ipod at the top 
   <doc id="IW-02" exclude="true" /> exclude this cable -->
 </query>

因此,您实际上注释掉了导致您异常的这两行

<doc id="MA147LL/A" />   put the actual ipod at the top 
<doc id="IW-02" exclude="true" /> exclude this cable

我希望它能解决你的问题。

于 2013-10-17T20:46:26.467 回答
1

您定义idint并从错误消息中尝试将此内容添加MA147LL/A到其中(NumberFormatException:对于输入字符串:“MA147LL/A”在)..

所以在你的 schema.xml 中使用以下行

<field name="id" type="string" indexed="true" stored="true" 
 required="true" multiValued="false" />

你应该没事

于 2013-10-17T12:44:27.933 回答