Hi!

I have an issue with Solr 7.3.1 in the spell checking component:

java.lang.NullPointerException at
org.apache.solr.search.CollapsingQParserPlugin$OrdFieldValueCollector.finish(CollapsingQParserPlugin.java:1021)
at
org.apache.solr.search.CollapsingQParserPlugin$OrdFieldValueCollector.finish(CollapsingQParserPlugin.java:1081)
at
org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:230)
at
org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1602)
at
org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1419)
at
org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:584)
...

I have found an issue that addresses a similiar problem:
https://issues.apache.org/jira/browse/SOLR-8807

The fix, which was introduced with this issue seems to miss our situation,
though. The relevant part of the query is this:

&fq={!tag=collapser}{!collapse field=productId sort='merchantOrder asc,
price asc, id asc'}

When I remove the local parameter {!tag=collapser} the collation works
fine. Looking at the diff of the commit of the issue mentioned above, it
seems that the "startsWith" could be the problem:

+        // Collate testing does not support the Collapse QParser (See
SOLR-8807)
+        params.remove("expand");
+        String[] filters = params.getParams(CommonParams.FQ);
+        if (filters != null) {
+          List<String> filtersToApply = new ArrayList<>(filters.length);
+          for (String fq : filters) {
+            if (!fq.startsWith("{!collapse")) {
+              filtersToApply.add(fq);
+            }
+          }
+          params.set("fq", filtersToApply.toArray(new
String[filtersToApply.size()]));
+        }

Can someone confirm this? I would open a bug ticket then. (Since the code
is unchanged in the latest version.)

Thanks,
Stefan

Reply via email to