When running Solr queries from Blacklight the query parser being used is the DisMax query parser. However, the query parser configured in my solrconfig.xml
file is the EDisMax parser. For some reason, Blacklight sends deftype=dismax
in the request to Solr and so overrides the desired deftype=edismax
value as it is defined in Solr's configuration.
How do I stop Blacklight from overriding the deftype
parameter?
Are you using Blacklight's Advanced Search gem? The dismax parser is hard coded in the tree.rb
file under lib/parsing_nesting
in the Advanced Search gem. If you want to use the edismax parser you have to create a new "parsing_nesting" directory under the "lib" directory. Copy the tree.rb
file to the "parsing_nesting" directory you have created. The easy (but kind of ugly) solution would be to replace all the "dismax" with "edismax" in the file. A better, but harder, solution would be to read the whole file thoroughly and change some function signatures so that they don't require the "force_deftype" parameter. Start with removing the :force_deftype => "dismax"
from the build_nested_query
function and see where this leads you.