Apache Solr for TYPO3 - Debug tools
Explain
With Apache Solr you have the possibility get a detailed explain output, that explains how the score was calculated for a certain document. In the end this helps to understand why which document is on the first position of the results page.
What does it do?
This explain output is very technical and detailed but also hard to understand. Inspired by explain.solr.pl we created a library to calculate the impact of each field. This data can be visualized e.g. in a chart to make it easier to understand that information.
EXT:solrdebugtools offers a set of ViewHelpers and partials that render this information in a pie chart:
Beside the parsed chart you still have the possibility to see the scoring explain for a single document:
How to use it?
EXT:solrdebugtools provides the following components to access this data:
- A ViewHelper "Debug\Explain" this ViewHelper is used to parse the explain data and make it available
- An example partial "Debug\Explain". This partials renders the information as a pie chart
- A TypoScript template "Configuration\TypoScript\Explain". This template enables the solr debug mode (plugin.tx_solr.enableDebugMode = 1) and loads the css.
- An entry for PartialRootPath pointing to EXT:solrdebugtools/Resources/Private/Partials/ plugin.tx_solr.view.partialRootPaths.XYZ = EXT:solrdebugtools/Resources/Private/Partials/
If you want to use it in your project you should:
- Render the explain partials in your project (Copy the default on or add EXT:solrdebugtools in the FLUID partial fallback chain):
To render the explain partials, you can extend your copy of the documents partials (EXT:solr/Resources/Private/Partials/Result/Document.html) and replace the old document score analysis:
<s:debug.documentScoreAnalyzer document="{document}" />
with the call of the new explain partial:
<f:render partial="Debug/Explain" section="Explain" arguments="{document: document, resultSet: resultSet}" />
- Load the TypoScript template "Search Debug - Configure explain"
Query
EXT:solr generates a query for Apache Solr based on configuration and user input. This query is important for debuging. It helps to understand the order or to manually execute this query on the solr server.
How to use it???
EXT:solrdebugtools provides the following components to access the query:
- A ViewHelper to get the current query "Debug\Query"
- A example partial "Debug\Query" that renders the current executed query.
If you want to use it in your project you should:
- Render the debug/query partials and pass the resultSet in arguments
<f:render partial="Debug/Query" section="Query" arguments="{resultSet: resultSet}" />
For example inside /Resources/Private/Templates/Search/Results.html