我需要过滤与我们的cms中的访问权限相对应的solr搜索结果(drupal 7 +基于位掩码的自定义访问控制机制)。
有一个 Solr QParserPlugin 插件,用于基于整数字段的按位运算过滤搜索结果:https ://issues.apache.org/jira/browse/SOLR-1913 。
我在tomcat6(在debian系统上)上使用Solr 3.6.1(+ /var/lib/tomcat6/solr/lib/bitwise_filter_plugin.jar中的插件)和drupal模块search_api_solr提供的schema.xml和solrconfig.xml在模块问题队列中找到(如 SOLR-1913 问题中所示扩展)。
Solr 查询...
http://solr:8080/solr/select?qf=t_title&fl=*,score&fq={!bitwise field=is_bitmask op=AND source=1234}*
...失败并在错误日志中显示以下消息:
Sep 27, 2012 8:57:41 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select params={qf=t_title&fl=*,score&fq={!bitwise+field%3Dis_bitmask+op%3DAND+source%3D1234}} status=500 QTime=15
Sep 27, 2012 8:57:41 AM org.apache.solr.common.SolrException log
SEVERE: java.lang.NullPointerException
at org.apache.lucene.search.FilteredQuery.hashCode(FilteredQuery.java:268)
at java.util.AbstractList.hashCode(AbstractList.java:542)
at org.apache.solr.search.QueryResultKey.<init>(QueryResultKey.java:49)
at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1084)
at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:375)
at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:394)
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:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:636)
我在错误消息中唯一能看到的是插件是由 solr 调用的。
任何帮助将不胜感激,谢谢。