Question

I'm using solr to search a set of data by name (e.g. "Dan" or "Joe Smith"). I'd like to return the results specified by the query (edit: with a wildcard on the end) in an order specified by another indexed field double_score (e.g. 10.0 or 72.3). I currently have the following which fails to work at all:

<!-- Note that the default search is on the field name -->
<requestHandler name="/scoresearch" class="solr.SearchHandler" default="true">
   <!-- <lst name="invariants">
          <str name="q">{!boost b=sum(double_score) defType=dismax v=$qq}</str>
        </lst> -->
        <lst name="defaults">
          <str name="defType">dismax</str>    
          <str name="echoParams">explicit</str>
      <int name="rows">10</int>
     <!-- <str name="qq"></str> -->
      <str name="qf">double_score</str>
      <str name="debug">true</str>
      <str name="q.alt">*:*</str>
    </lst>
</requestHandler>

If I remove the comments, then the search does work s.t. whatever query I make is replaced by q.alt and then boosted by the value of double_score. If this didn't replace the q.alt, it would be the desired effect.

Also note that while I have not yet delved into more interesting possibilities such as tokenizing the names, I do plan to do so. So any possible suggestion/solution shouldn't preclude that.

No correct solution

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