所以我使用MultiCore功能将Solr设置为具有多个内核,并且工作正常:
http://localhost:8080/solr/core_one/select/?q=Book
按预期工作并列出结果。
现在我要做的就是将相同的查询发送给Solr,启用MoreLikeThis:
http://localhost:8080/solr/core_one/select/?q=Book&mlt=true&mlt.fl=category
我在org.apache.solr.schema.FieldType.storedToIndexed 获得 HTTP状态500 - null java.lang.NullPointerException。 mlt.fl的字段存在。有趣的是,如果我查询没有任何结果的东西,Solr会正确返回一个空的结果集。
这是一个错误还是我错过了什么?
这是完整的堆栈跟踪:
HTTP Status 500 - null java.lang.NullPointerException at
org.apache.solr.schema.FieldType.storedToIndexed(FieldType.java:360) at
org.apache.solr.handler.MoreLikeThisHandler$MoreLikeThisHelper.getMoreLikeThis(MoreLikeThisHandler.java:320) at
org.apache.solr.handler.component.MoreLikeThisComponent.getMoreLikeThese(MoreLikeThisComponent.java:82) at
org.apache.solr.handler.component.MoreLikeThisComponent.process(MoreLikeThisComponent.java:57) at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at
org.apache.solr.core.SolrCore.execute(SolrCore.java:1368) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:679)
答案 0 :(得分:5)
MoreLikeThis需要存储的唯一密钥。