eDisMax
The
Extended Disjunction Maximum "eDisMax" Query Parser is a powerful Solr query parser your team can implement to customize your implementation of Acquia Search. eDisMax is an improved version of the
DisMax query parser.
The original DisMax query parser was created to reduce the number of errors in user-facing systems with limited management control that result from direct user queries. The problems that usually arose in these kinds of systems were often down to the fact that they exposed technical inputs to non-technical people.
Among eDisMax’s main features lies its ‘boost’ parameter. Boost raises the score of a query in similar fashion to DisMax’s ‘bf’ parameter, but it’s multiplicative not additive, (if you are interested in knowing more, you can find other features here).
If implemented incorrectly, eDisMax can negatively impact the performance of Solr and your Acquia Search implementation. Follow the below guidelines when implementing eDisMax for your Acquia Search implementation to prevent negative performance impacts.
How to configure edismax on Drupal
Edismax is available in the search solr api module. When you install and configure acquia_connector you have the option to enable/disable in the module configuration in edit search index configuration page. If you are seeing performance degradation Acquia recommends you disable this feature.
eDisMax limitations
Edismax can be useful but the key to picking the right parser is in knowing its limitations.
eDisMax’s ability to search across multiple fields does not always bring advantages. This is especially true when it comes to performance. From a time efficiency point of view, it makes sense that searching query terms across every specified field in the ‘qf’ parameter will be slower than searching just one field. However, eDisMax does give the option of using Lucene syntax, which can help speed things up.
Relevancy¶
The name eDisMax relates to the parser’s approach to computing a matched documents’ score. When computing the relevancy of a term, it only takes into account the top score fields per document; among all distinctly scored alternatives, the ‘disjunction’, it chooses the ‘maximum’.
We can use eDisMax’s tie breaker parameter to control the percentile weighting of each field when calculating total score per product. Values can be set between ‘0’ and ‘1’, where ‘0’ means choosing the maximum and ‘1’ means doing a sum, (echoing Lucene behavior).
This kind of relevancy approach only relates to the best scored fields in each document. Its final relevancy score won’t be fully representative of how well the complete document is scored. Lucene’s computation arguably makes more accurate relevance assessments by taking into account all scores.
Multiple Field Query Search¶
Searching over several fields with eDisMax can be approached using a Lucene parser. Instead of the ‘qf’ parameter, we can use boolean operators to specify each field we need to search.
This approach can be tedious when needing to search across many fields.
For example, the query below uses eDisMax as the query parser:
Once the query has been transformed into Lucene objects, we can see that a boolean operation has been applied:
This query uses Standard Query Parser syntax:
In this case, transformation into Lucene objects is far simpler: