Skip to content

Commit 816877a

Browse files
committed
[FEATURE] Make EXT:solrdebogtools plug-and-play installable
This change provides a placeholder Fluid partials to be able to use EXT:solrdebugtools as plug&play addon with default EXT:solr templates. Fixes: #4237
1 parent ca4cf26 commit 816877a

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
2+
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
3+
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers"
4+
data-namespace-typo3-fluid="true"
5+
>
6+
<f:comment><!--
7+
This file is a placeholder to allow EXT:solrdebugtools work as plug&play addon.
8+
9+
Explain addon
10+
11+
With Apache Solr you have the possibility get a detailed explain output, that explains how the score was calculated for a certain document.
12+
In the end this helps to understand why which document is on the first position of the results page.
13+
14+
What does it do?
15+
16+
Apache Solr's explain-output is very technical and detailed but also hard to understand.
17+
Inspired by explain.solr.pl we created a library to calculate the impact of each field.
18+
This data can be visualized e.g. in a chart to make it easier to understand that information.
19+
20+
--></f:comment>
21+
<f:section name="Explain"><s:debug.documentScoreAnalyzer document="{document}" /></f:section>
22+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
2+
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
3+
data-namespace-typo3-fluid="true"
4+
>
5+
<f:comment><!--
6+
This file is a placeholder to allow EXT:solrdebugtools work as plug&play addon.
7+
8+
EXT:solr generates a query for Apache Solr based on configuration and user input.
9+
This query is important for debugging.
10+
It helps to understand the order or to manually execute this query on the solr server.
11+
You can try the query-settings in Apache Solr admin UI and then transfer them into TypoScript configurations or implement new features.
12+
13+
NOTE: The debug-query may not work properly if POST-Big-Request solarium plugin is enabled. See: TYPO3-Solr/ext-solr#3115 (comment)
14+
15+
--></f:comment>
16+
<f:section name="Query"/>
17+
</html>

Resources/Private/Partials/Result/Document.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h3 class="results-topic"><a href="{s:uri.result.addSearchWordList(url:document.
4444
</p>
4545
</f:if>
4646

47-
<f:variable name="documentScoreAnalyze"><s:debug.documentScoreAnalyzer document="{document}" /></f:variable>
47+
<f:variable name="documentScoreAnalyze"><f:render partial="Debug/Explain" section="Explain" arguments="{document: document, resultSet: resultSet}" /></f:variable>
4848
<f:if condition="{documentScoreAnalyze}">
4949
<div class="query-debug alert alert-info" role="alert"><f:format.raw>{documentScoreAnalyze}</f:format.raw></div>
5050
</f:if>

Resources/Private/Templates/Search/Results.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<f:section name="content">
1010
<div id="tx-solr-search" class="d-grid gap-3">
1111

12+
<div class="row">
13+
<div class="col-12">
14+
<f:render partial="Debug/Query" section="Query" arguments="{resultSet: resultSet}" />
15+
</div>
16+
</div>
17+
1218
<div class="row">
1319
<div class="tx-solr-search-form col-lg-8">
1420
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />

0 commit comments

Comments
 (0)