Use qt=dismax rather than defType=dismax ?

352 views
Skip to first unread message

Tom Coleman

unread,
Oct 11, 2009, 10:17:41 PM10/11/09
to Sunspot
Would it make sense to do this?

That way sunspot would use the requesthandler as defined in
solrconfig.xml, allowing a user to tweak the default parameters (e.g.
the mm parameter).

Mat Brown

unread,
Oct 12, 2009, 9:31:15 AM10/12/09
to ruby-s...@googlegroups.com
Hi Tom,

I'd decided to just use defType=dismax based on the note on the DisMax
documentation page (http://wiki.apache.org/solr/DisMaxRequestHandler),
but it's an intriguing idea - especially since it seems plausible to
construct a handler that could do both dismax and LocalSolr requests
using subqueries, something I've so far been unable to do. Let me play
around with it - feel free to let me know the results of any
experimentation you do on that front.

Thanks!
Mat

Tom Coleman

unread,
Oct 12, 2009, 7:03:08 PM10/12/09
to Sunspot
Hey Mat,

Well my experimentation is pretty limited :) I just changed the name
of the param from defType to qt, and it seemed to work fine. Certainly
it meant that stuff like this in the solrconfig.xml had an effect:

<requestHandler name="dismax" class="solr.SearchHandler" >
<lst name="defaults">
<str name="mm">1</str>
</lst>
</requestHandler>

This is no big deal for me really, I mean the default value of mm in
the dismax parser is fairly sensible. I was just playing around and
wondered if there was some reason why you had done one way rather than
the other.

Tom

Sean Bowman

unread,
Oct 18, 2009, 4:00:11 AM10/18/09
to Sunspot
Just so you know, defType and qt have nothing to do with one another.
The qt attribute is a label used to define a search handler and all of
its customizations in the solrconfig.xml file, while defType is a
parameter that's used to tell a SearchHandler what type of query
parser to use.

For example, if you wanted a dismax query that searched a field called
"category" with a boost of 2.0 and sorted by the date the document was
added to the index, you could define a search handler in
solrconfig.xml called "category_search" with those options. Your qt
would then be "category_search". Sending a defType would just run a
standard dismax query with all the defaults.
Reply all
Reply to author
Forward
0 new messages