solr group.field 空指针异常 [英] solr group.field nullpointer exception

查看:69
本文介绍了solr group.field 空指针异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 solr 的组功能时遇到问题.我根本无法使用该功能.这是问题的描述.

I have problem using group feature of solr. I simply can't use the feature. Here is the description of the problem.

我使用的组字段定义如下.

The group field that I use is defined as follows.

field name="clusterid" type="string" indexed="true" stored="true" multiValued="false"

field name="clusterid" type="string" indexed="true" stored="true" multiValued="false"

索引的clusterid"字段具有有效值.

The indexed "clusterid" field has valid values.

最初,我尝试在上述字段中使用 Solrj 客户端 API 使用组"功能.我开始收到HTTP 状态 500 内部服务器错误..." 假设语法或参数的顺序可能是一个问题,我决定使用 Firefox 浏览器测试相同的功能.

Initially, I tried using "group" feature using Solrj client API on the above field. I started getting "HTTP status 500 Internal Server Errors..." Assuming that the syntax or the ordering of the parameters could be an issue, I decided to test the same feature using firefox browser.

.../solr/select/?q=title%3Acomputer

使用有效的 clusterid 产生一组不错的结果.

yields a nice set of results with valid clusterid(s).

但是,当我尝试使用 clusterid 字段对结果进行分组时,出现空指针异常.这是用于分组的网址

However, when I try to group the results using the clusterid field, I get a null pointer exception. Here is the url that was used for grouping

.../solr/select/?q=title%3Acomputer&group=true&group.field=clusterid

响应是

输入状态报告

消息 null java.lang.NullPointerException atorg.apache.solr.handler.clustering.ClusteringComponent.process(ClusteringComponent.java:89)在org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:186)在org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)在 org.apache.solr.core.SolrCore.execute(SolrCore.java:1376) 在org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)在org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)在org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)在org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)在org.apache.tomcat.util.net.JioEndpoint$Worker.run(JioEndpoint.java:489)在 java.lang.Thread.run(Thread.java:662)

message null java.lang.NullPointerException at org.apache.solr.handler.clustering.ClusteringComponent.process(ClusteringComponent.java:89) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:186) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260) 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.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662)

注意:我在 Windows XP 上使用 solr 版本 3.6.2.solrconfig 文件仅对默认设置的内存设置(增加值)进行了更改.

Note: I use the solr version 3.6.2 on Windows XP. The solrconfig file has changes only for the memory settings (increase value) from the default ones.

当我尝试使用多值字段作为组字段时,响应消息非常清楚多值"字段不能用于分组.当我使用非字符串字段进行测试时,我再次得到响应,这些字段不是字符串字段等.

When I tried to use a multivalued field as group field, the response message was very clear that "multiValued" fields can not be used for grouping. When I tested with non-string fields, again I got responses that those were not string fields etc.

但是当提供了字符串类型的字段(clusterid 或任何其他字符串类型的字段)时——抛出空指针异常.

But when a field of string type (either clusterid or any other field that is of string type) was provided -- null pointer exception was thrown.

我是否遗漏了任何明显的内容(在架构或 solrconfig 文件中)?

Do I miss anything that is obvious (in the schema or the solrconfig file)?

推荐答案

我在使用 Solr 6.3 时遇到了同样的问题.看来聚类组件(您显然正在使用)无法从组响应中提取所需的数据.我发现的唯一解决方法是启用突出显示,然后聚类似乎可以工作;但这会带来显着的性能损失.但是,如果您的结果规模很小,它可能是您的一个选择;对于更大的结果(> 200-300 文档),聚类似乎比突出显示花费更多的时间.我正在使用 Lingo 算法,也许使用 STC 会更好.

I'm facing the same issue using Solr 6.3. It appears the clustering component (which you are apparently using) is unable to extract the data it needs from a group response. The only workaround I found is to enable highlighting, then clustering appears to work; but this comes with a significant performance penalty. However if your result size is small it may be an option for you; for larger results (> 200-300 docs), clustering appears to be taking more time than highlighting anyway. I'm using the Lingo algorithm, maybe with STC it would be better.

这篇关于solr group.field 空指针异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆