如何通过多核设置使用 Solr 的 MoreLikeThis 功能?
因此,我使用多核功能设置了具有多个核心的 Solr,该功能运行良好:
http://localhost:8080/solr/core_one/select/?q=Book
按预期工作并列出结果。
现在我想做的就是在启用 MoreLikeThis 的情况下向 Solr 发送相同的查询:
http://localhost:8080/solr/core_one/select/?q=Book&mlt=true&mlt.fl=category
我在 org.apache.solr.schema.FieldType.storedToIndexed 处收到 HTTP Status 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)
So I have set up Solr with multiple cores using the MultiCore feature which works fine:
http://localhost:8080/solr/core_one/select/?q=Book
Works as expected and lists results.
Now all I want to do is send the same query to Solr with MoreLikeThis enabled:
http://localhost:8080/solr/core_one/select/?q=Book&mlt=true&mlt.fl=category
I get a HTTP Status 500 - null java.lang.NullPointerException at org.apache.solr.schema.FieldType.storedToIndexed. The field for mlt.fl exists. The funny thing is if I query something that does not have any results Solr properly returns an empty result set.
So is this a bug or am I missing something?
This is the full stack trace:
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MoreLikeThis 需要存储唯一的密钥。
MoreLikeThis requires a stored unique key.