first commit
This commit is contained in:
@@ -27,9 +27,9 @@ use WapplerSystems\Meilisearch\System\Records\SystemCategory\SystemCategoryRepos
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* This Processor takes a UID of sys_category, and resolves its rootline in solr notation.
|
||||
* This Processor takes a UID of sys_category, and resolves its rootline in meilisearch notation.
|
||||
*
|
||||
* Format of this field corresponds to http://wiki.apache.org/solr/HierarchicalFaceting
|
||||
* Format of this field corresponds to http://wiki.apache.org/meilisearch/HierarchicalFaceting
|
||||
*
|
||||
* Let's say we have a category with uid 111 which is a sub category like shown in this tree:
|
||||
*
|
||||
@@ -40,7 +40,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
*
|
||||
* then we get a rootline 1/10/100/111
|
||||
*
|
||||
* In Solr hierarchy notation, we get
|
||||
* In Meilisearch hierarchy notation, we get
|
||||
*
|
||||
* 0-1
|
||||
* 1-1/10
|
||||
@@ -69,7 +69,7 @@ class CategoryUidToHierarchy extends AbstractHierarchyProcessor implements Field
|
||||
}
|
||||
|
||||
/**
|
||||
* Expects a uid ID of a category. Returns a Solr hierarchy notation for the
|
||||
* Expects a uid ID of a category. Returns a Meilisearch hierarchy notation for the
|
||||
* rootline of the category ID.
|
||||
*
|
||||
* @param array $values Array of values, an array because of multivalued fields
|
||||
@@ -81,24 +81,24 @@ class CategoryUidToHierarchy extends AbstractHierarchyProcessor implements Field
|
||||
|
||||
foreach ($values as $value) {
|
||||
$results = array_merge($results,
|
||||
$this->getSolrRootlineForCategoryId($value));
|
||||
$this->getMeilisearchRootlineForCategoryId($value));
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Solr hierarchy notation string for rootline of given category uid.
|
||||
* Returns a Meilisearch hierarchy notation string for rootline of given category uid.
|
||||
*
|
||||
* @param int $categoryId Category ID to get a rootline as Solr hierarchy for
|
||||
* @return array Rootline as Solr hierarchy array
|
||||
* @param int $categoryId Category ID to get a rootline as Meilisearch hierarchy for
|
||||
* @return array Rootline as Meilisearch hierarchy array
|
||||
*/
|
||||
protected function getSolrRootlineForCategoryId($categoryId)
|
||||
protected function getMeilisearchRootlineForCategoryId($categoryId)
|
||||
{
|
||||
$categoryIdRootline = $this->buildCategoryIdRootline($categoryId);
|
||||
$solrRootline = $this->buildSolrHierarchyFromIdRootline($categoryIdRootline);
|
||||
$meilisearchRootline = $this->buildMeilisearchHierarchyFromIdRootline($categoryIdRootline);
|
||||
|
||||
return $solrRootline;
|
||||
return $meilisearchRootline;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user