Commit 4bc56018 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch 'develop' into 'main'

Release 20-06-22

See merge request !492
parents 75148445 643a5224
Pipeline #28269 passed with stages
in 6 minutes and 19 seconds
......@@ -29,7 +29,6 @@ use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Fluid\View\StandaloneView;
class SolrSearch implements MiddlewareInterface
......@@ -92,7 +91,6 @@ class SolrSearch implements MiddlewareInterface
return $response;
}
$searchResultSetService = GeneralUtility::makeInstance(SearchResultSetService::class, $typoscriptConfiguration, $search);
$searchResultSetService->injectObjectManager(GeneralUtility::makeInstance(ObjectManager::class));
$searchResultSet = $searchResultSetService->search($searchRequest);
if ($queryParams['ajaxsearch'] === 'raw') {
......
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
<html
xmlns="http://www.w3.org/1999/xhtml"
lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/">
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/"
>
<f:layout name="Main"/>
......@@ -8,7 +11,16 @@
<div id="tx-solr-search">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />
<f:render
partial="Search/Form"
section="Form"
arguments="{
search: search,
additionalFilters: additionalFilters,
pluginNamespace: pluginNamespace,
resultSet: resultSet
}"
/>
<f:if condition="{resultSet.isAutoCorrected}">
<f:then>
......@@ -17,7 +29,6 @@
<s:translate key="no_results_search_for_original" arguments="{0: resultSet.correctedQueryString}">Search instead for "%s".</s:translate>
</span>
</f:then>
<f:else>
<f:if condition="{resultSet.usedQuery.keywordsCleaned}">
<span class="searched-for">
......@@ -30,9 +41,13 @@
<f:if condition="{resultSet.hasSpellCheckingSuggestions}">
<f:then>
<s:translate key="didYouMean">Did you mean</s:translate>
<f:for each="{resultSet.spellCheckingSuggestions}" as="suggestion">
<f:link.page additionalParams="{q:suggestion.suggestion}">{suggestion.suggestion}</f:link.page>
</f:for> ?
<f:link.page additionalParams="{q:suggestion.suggestion}">
{suggestion.suggestion}
</f:link.page>
</f:for>
?
</f:then>
</f:if>
......@@ -49,36 +64,68 @@
</f:if>
<f:if condition="{resultSet.hasSearched}">
<div class="container search-filter mb-4">
<div class="container search-filter my-4">
<f:if condition="{resultSet.searchResults}">
<f:then>
<div class="row">
<div class="col-12">
<f:variable name="facetUsed" value="0" />
<f:for each="{resultSet.facets}" as="facet">
<f:if condition="{facet.isUsed}">
<f:variable name="facetUsed" value="1" />
<f:variable name="facetUsed" value="1"/>
</f:if>
</f:for>
<ul class="nav nav-tabs nav-fill">
<li class="nav-item">
<a href="{s:uri.facet.removeAllFacets()}" class="nav-link{f:if(condition:'{facetUsed}', else:' active')}"">
<a href="{s:uri.facet.removeAllFacets()}" class="nav-link{f:if(condition:'{facetUsed}', else:' active')}">
All
<span class="badge badge-dark">{allResultCountWithoutFacets}</span>
</a>
</li>
<f:if condition="{resultSet.hasSearched}">
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" />
<f:render
partial="Result/Facets"
section="Facets"
arguments="{resultSet:resultSet}"
/>
</f:if>
</f:if>
</ul>
</div>
</div>
<ol start="{pagination.displayRangeStart}" class="results-list">
<f:for each="{resultSet.searchResults}" as="document">
<f:render partial="Result/Document" section="Document" arguments="{resultSet:resultSet, document:document}" />
<f:render
partial="Result/Document"
section="Document"
arguments="{
resultSet: resultSet,
document: document
}"
/>
</f:for>
<f:render partial="Result/Pagination" section="Pagination" arguments="{resultSet: resultSet, pagination: pagination, currentPage: currentPage}" />
<f:render
partial="Result/Pagination"
section="Pagination"
arguments="{
resultSet: resultSet,
pagination: pagination,
currentPage: currentPage
}"
/>
</ol>
</f:then>
<f:else>
<h2>No search results found.</h2>
</f:else>
</f:if>
</div>
</f:if>
</div>
......@@ -86,18 +133,35 @@
<div id="tx-solr-search-functions">
<f:if condition="{hasSearched}">
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchSorting}">
<f:render partial="Result/Sorting" section="Sorting" arguments="{resultSet:resultSet}" />
<f:render
partial="Result/Sorting"
section="Sorting"
arguments="{resultSet: resultSet}"
/>
</f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" />
<f:render
partial="Result/Facets"
section="Facets"
arguments="{resultSet: resultSet}"
/>
</f:if>
</f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchLastSearches}">
<f:render partial="Search/LastSearches" section="LastSearches" arguments="{resultSet:resultSet}" />
<f:render
partial="Search/LastSearches"
section="LastSearches"
arguments="{resultSet: resultSet}"
/>
</f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFrequentSearches}">
<f:render partial="Search/FrequentlySearched" section="FrequentlySearched" />
<f:render
partial="Search/FrequentlySearched"
section="FrequentlySearched"
/>
</f:if>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment