The MDEX Engine provides several methods for understanding why certain results were returned for a query so that you can determine how to tune search features to provide the desired results.
The MDEX Engine query debugging features include Why Match, Word Interpretation, Why Rank, and Why Precedence Rule Fired. Each feature provides information about a different aspect of search results.
Feature |
Description |
---|---|
Why Match |
Augments record results with information about which record properties were involved in search matching. |
Why Rank |
Augments record results with information about which relevance ranking modules ordered the results and why a particular record was ranked in the way that it was. |
Why Precedence Rule Fired |
Augments root dimension values with information about how the precedence rule was triggered (explicitly or implicitly), which dimension ID and name triggered the precedence rule, and the type of precedence rule (standard, leaf, or default). |
Word Interpretation |
Reports word or phrase substitutions made during text search processing due to stemming, thesaurus expansion, or spelling correction. |
You enable the
query debugging features on an Assembler application via the
debugEnabled
constructor argument on your
MdexRequestBroker
object. In the Discover Electronics
reference application, this is configured in the MDEX Resource section of the
Spring context file for the Assembler.
When
debugEnabled
is set to
true
, it enables query debugging features to be applied
to an Assembler request. When set to
false
, debugging features are turned off for every
request. Debugging features are disabled by default.
In addition to the corresponding object configuration, Word
Interpretation must be enabled via the
--wordInterp
Dgraph flag.
The following shows the default MDEX resource configuration in the Discover Electronics application:
<bean id="mdexRequestBuilder" scope="request" class="com.endeca.infront.navigation.request.MdexRequestBroker">
<constructor-arg ref="mdexResource" />
<!-- Debug Enabled Parameter. When set to true, allows debug information to be returned from the Assembler -->
<constructor-arg value="false"/>
</bean>
All query debugging features except for Word Interpretation may be enabled on a per-query basis via URL parameters.
The following parameters take a value of
1
(for enabled) or
0
(for disabled):
The Word Interpretation feature can only be enabled at the level of an individual cartridge handler.
Note
If the debug constructor argument on the MDEX resource bean is
set to
false
, all debugging features are disabled on every
request regardless of URL parameters.
In Discover Electronics, the results of query debugging can be returned as part of the response model for the Results List, Search Adjustments, and Refinement Menu cartridges as appropriate. In the Discover Electronics reference application, these results can be enabled by removing comments from the corresponding properties in each cartridge handler.
The debugging results are returned as properties on returned records:
Feature |
Results |
---|---|
Why Match |
Returns information about why each record
matched the query in a
|
Why Rank |
Returns information about why each record was
ranked the way it was in a
|
Why Precedence Rule Fired |
Returns information about precedence rules
that fired on a query in a
|
Word Interpretation |
Returns information about word or phrase
substitutions as a map that can be accessed via
|
For details about the format of the debugging results, refer to the MDEX Engine Developer's Guide.
Note
The renderers in the Discover Electronics application do not include rendering logic to display the query debugging properties, but the information is available from the JSON or XML view.
The relevant configuration for the individual cartridge handlers in the Discover Electronics reference application is shown below:
Results List — Why Match, Why Rank
<bean class="com.endeca.infront.cartridge.ResultsListConfig" scope="singleton"> <!-- <property name="whyMatchEnabled" value="true"/> --> <!-- <property name="whyRankEnabled" value="true"/> --> <!-- additional elements omitted from this example --> </bean>
Enabling these settings overrides the default values specified for the
setWhyMatchEnabled
andsetWhyRankEnabled
methods on thecom.endeca.infront.cartridge.ResultsListConfig
object when the Tools Service is initialized.Refinement Menu — Why Precedence Rule Fired
<bean class="com.endeca.infront.cartridge.RefinementMenuConfig" scope="singleton"> <property name="moreLinkText" value="More..."/> <!-- <property name="whyPrecedenceRuleFired" value="true"/> --> </bean>
Enabling this setting overrides the default value specified for the
setWhyPrecedenceRuleFired
method on thecom.endeca.infront.cartridge.RefinementMenuConfig
object when the Tools Service is initialized.Search Adjustments — Word Interpretation
<bean class="com.endeca.infront.cartridge.SearchAdjustmentsConfig" scope="singleton"> <!-- <property name="showWordInterp" value="true"/> --> </bean>
Enabling this setting overrides the default value specified for the
setShowWordInterp
method on thecom.endeca.infront.cartridge.SearchAdjustmentsConfig
object when the Tools Service is initialized.