first commit
This commit is contained in:
@@ -16,7 +16,7 @@ namespace WapplerSystems\Meilisearch\Domain\Search\ResultSet\Facets\OptionBased\
|
||||
|
||||
use WapplerSystems\Meilisearch\Domain\Search\ResultSet\Facets\AbstractFacetParser;
|
||||
use WapplerSystems\Meilisearch\Domain\Search\ResultSet\SearchResultSet;
|
||||
use WapplerSystems\Meilisearch\System\Solr\ParsingUtil;
|
||||
use WapplerSystems\Meilisearch\System\Meilisearch\ParsingUtil;
|
||||
|
||||
/**
|
||||
* Class HierarchyFacetParser
|
||||
@@ -34,9 +34,9 @@ class HierarchyFacetParser extends AbstractFacetParser
|
||||
$response = $resultSet->getResponse();
|
||||
$fieldName = $facetConfiguration['field'];
|
||||
$label = $this->getPlainLabelOrApplyCObject($facetConfiguration);
|
||||
$optionsFromSolrResponse = isset($response->facet_counts->facet_fields->{$fieldName}) ? ParsingUtil::getMapArrayFromFlatArray($response->facet_counts->facet_fields->{$fieldName}) : [];
|
||||
$optionsFromMeilisearchResponse = isset($response->facet_counts->facet_fields->{$fieldName}) ? ParsingUtil::getMapArrayFromFlatArray($response->facet_counts->facet_fields->{$fieldName}) : [];
|
||||
$optionsFromRequest = $this->getActiveFacetValuesFromRequest($resultSet, $facetName);
|
||||
$hasOptionsInResponse = !empty($optionsFromSolrResponse);
|
||||
$hasOptionsInResponse = !empty($optionsFromMeilisearchResponse);
|
||||
$hasSelectedOptionsInRequest = count($optionsFromRequest) > 0;
|
||||
$hasNoOptionsToShow = !$hasOptionsInResponse && !$hasSelectedOptionsInRequest;
|
||||
$hideEmpty = !$resultSet->getUsedSearchRequest()->getContextTypoScriptConfiguration()->getSearchFacetingShowEmptyFacetsByName($facetName);
|
||||
@@ -53,7 +53,7 @@ class HierarchyFacetParser extends AbstractFacetParser
|
||||
|
||||
$facet->setIsAvailable($hasOptionsInResponse);
|
||||
|
||||
$nodesToCreate = $this->getMergedFacetValueFromSearchRequestAndSolrResponse($optionsFromSolrResponse, $optionsFromRequest);
|
||||
$nodesToCreate = $this->getMergedFacetValueFromSearchRequestAndMeilisearchResponse($optionsFromMeilisearchResponse, $optionsFromRequest);
|
||||
|
||||
if ($this->facetOptionsMustBeResorted($facetConfiguration)) {
|
||||
$nodesToCreate = $this->sortFacetOptionsInNaturalOrder($nodesToCreate);
|
||||
@@ -96,13 +96,13 @@ class HierarchyFacetParser extends AbstractFacetParser
|
||||
/**
|
||||
* Checks if options must be resorted.
|
||||
*
|
||||
* Apache Solr facet.sort can be set globally or per facet.
|
||||
* Meilisearch facet.sort can be set globally or per facet.
|
||||
* Relevant TypoScript paths:
|
||||
* plugin.tx_meilisearch.search.faceting.sortBy causes facet.sort Apache Solr parameter
|
||||
* plugin.tx_meilisearch.search.faceting.sortBy causes facet.sort Meilisearch parameter
|
||||
* plugin.tx_meilisearch.search.faceting.facets.[facetName].sortBy causes f.<fieldname>.facet.sort parameter
|
||||
*
|
||||
* see: https://lucene.apache.org/solr/guide/6_6/faceting.html#Faceting-Thefacet.sortParameter
|
||||
* see: https://wiki.apache.org/solr/SimpleFacetParameters#facet.sort : "This parameter can be specified on a per field basis."
|
||||
* see: https://lucene.apache.org/meilisearch/guide/6_6/faceting.html#Faceting-Thefacet.sortParameter
|
||||
* see: https://wiki.apache.org/meilisearch/SimpleFacetParameters#facet.sort : "This parameter can be specified on a per field basis."
|
||||
*
|
||||
* @param array $facetConfiguration
|
||||
* @return bool
|
||||
|
@@ -29,7 +29,7 @@ class HierarchyTool
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces @@@slash@@@ with \/ to have the path usable for solr again.
|
||||
* Replaces @@@slash@@@ with \/ to have the path usable for meilisearch again.
|
||||
*
|
||||
* @param string $pathWithReplacedContentSlashes
|
||||
* @return string
|
||||
|
@@ -27,7 +27,7 @@ namespace WapplerSystems\Meilisearch\Domain\Search\ResultSet\Facets\OptionBased\
|
||||
use WapplerSystems\Meilisearch\Domain\Search\ResultSet\Facets\FacetUrlDecoderInterface;
|
||||
|
||||
/**
|
||||
* Filter encoder to build Solr hierarchy queries from tx_meilisearch[filter]
|
||||
* Filter encoder to build Meilisearch hierarchy queries from tx_meilisearch[filter]
|
||||
*
|
||||
* @author Ingo Renner <ingo@typo3.org>
|
||||
*/
|
||||
@@ -42,11 +42,11 @@ class HierarchyUrlDecoder implements FacetUrlDecoderInterface
|
||||
const DELIMITER = '/';
|
||||
|
||||
/**
|
||||
* Parses the given hierarchy filter and returns a Solr filter query.
|
||||
* Parses the given hierarchy filter and returns a Meilisearch filter query.
|
||||
*
|
||||
* @param string $hierarchy The hierarchy filter query.
|
||||
* @param array $configuration Facet configuration
|
||||
* @return string Lucene query language filter to be used for querying Solr
|
||||
* @return string Lucene query language filter to be used for querying Meilisearch
|
||||
*/
|
||||
public function decode($hierarchy, array $configuration = [])
|
||||
{
|
||||
|
Reference in New Issue
Block a user