I have a dismax handler to match product names found in free text that looks like:

  <!-- for thing detection -->
  <requestHandler name="thing" class="solr.DisMaxRequestHandler" >
    <lst name="defaults">
     <str name="echoParams">explicit</str>
     <float name="tie">0.01</float>
     <str name="qf">
        name^5 nec_name^3 ne_name
     </str>
     <str name="fl">
       *
     </str>
     <int name="ps">100</int>
     <str name="q.alt">*:*</str>
    </lst>
  </requestHandler>

name is type string, nec_name and ne_name are special types that do domain-specific stopword removal, latin1 munging etc, all are confirmed working fine on their own.

Say I have a product called "SUPERBOT" and I want the text "I love SUPERBOT" to match the product SUPERBOT pretty high.

In Lucene or Solr on its own you'd do something like:

name:(I love SUPERBOT)^5 nec_name:(I love SUPERBOT)^3 ne_name:(I love SUPERBOT)

which works fine.  And so does:

qt=thing&q=SUPERBOT

But this doesn't work:

qt=thing&q=(I%20love%20SUPERBOT)

nor does

qt=thing&q=I%20love%20SUPERBOT

-- they get no results.

How can we do "grouped clause" queries in dismax?





Reply via email to