Question

I have the following request handler which searches two text_en fields, Title and Body. The query works find without the minimum match setting. If I use the mm field, and if my search string is above 2 terms, I get:

null:java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.solr.util.SolrPluginUtils.calculateMinShouldMatch(SolrPluginUtils.java:547)

My Request handler:

  <requestHandler name="/broadQuery" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="defType">edismax</str>
        <str name="wt">xml</str>
        <str name="fl">ListingId</str>
        <str name="qf">Title^2 Body</str>
        <str name="rows">100</str>
        <str name="pf">Title^4 Body^2</str>
        <str name="ps">0</str>
        <str name="echoParams">all</str>

        <str name="mm">2 3&lt;-1 5&lt;-2 6&lt;-40%</str> <!-- HERE -->
    </lst>
  </requestHandler>

Problem: What is causing this, and how can it be solved.

Was it helpful?

Solution

I think your mm param is mis-formed. According to the spec, you can only combine multiple conditional params. Yet, your first param (2) is not conditional. Can you rewrite the whole expression as a set of conditional parameters and see if this goes away.

Or, I would try from their example (2<-25% 9<-3) and see if you get the same issue. If you do not, keep modifying it towards yours until you hit the problem or get what you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top