Community Documentation

Concepts: use of the Dismax/EDismax query handler

Last updated April 21, 2011. Created by pwolanin on April 21, 2011.
Log in to edit this page.

The solrconfig.xml distributed with Apache Solr uses the "Dismax" query parser by default. This is designed to take in raw keyword searches from the user, and then search across multiple fields in each document as speficied in the module settings. So you can't search for separate fields with the standard Lucene query syntax (like "entity:node") - you will always get 0 results.

It is actually a very good practice, as it makes it impossible for normal users to search for specific nodes from the normal query box (and maybe exposing sensitive data).

However, if you are doing custom code development you need to make changes to use full syntax. One option is to leave the 'q' parameter empty, and pass the q.alt parameter to dismax, which can handle full lucene syntax. You can also add a parameter "qt=standard" to the query, and it will use the normal query parser with the contents of the 'q' param.

note that Solr 3.1 supports the EDismax parser, which should allow lucene syntax while also handling raw keyword searches robustly.

About this page

Audience
Developers and coders, Site administrators
Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here