first commit

This commit is contained in:
Sven Wappler
2021-04-17 21:20:54 +02:00
parent c93ec9492a
commit cadcc8edb4
406 changed files with 4917 additions and 5157 deletions

View File

@@ -33,13 +33,13 @@ abstract class AbstractHierarchyProcessor
{
/**
* Builds a Solr hierarchy from an array of uids that make up a rootline.
* Builds a Meilisearch hierarchy from an array of uids that make up a rootline.
*
* @param array $idRootline Array of Ids representing a rootline
* @return array Solr hierarchy
* @see http://wiki.apache.org/solr/HierarchicalFaceting
* @return array Meilisearch hierarchy
* @see http://wiki.apache.org/meilisearch/HierarchicalFaceting
*/
protected function buildSolrHierarchyFromIdRootline(array $idRootline)
protected function buildMeilisearchHierarchyFromIdRootline(array $idRootline)
{
$hierarchy = [];

View File

@@ -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;
}
/**

View File

@@ -29,9 +29,9 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\RootlineUtility;
/**
* This Processor takes a PID, and resolves its rootline in solr notation.
* This Processor takes a PID, 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 record indexed on page 111 which is a sub page like shown in this page tree:
*
@@ -42,7 +42,7 @@ use TYPO3\CMS\Core\Utility\RootlineUtility;
*
* 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/
@@ -57,7 +57,7 @@ class PageUidToHierarchy extends AbstractHierarchyProcessor implements FieldProc
{
/**
* Expects a page ID of a page. Returns a Solr hierarchy notation for the
* Expects a page ID of a page. Returns a Meilisearch hierarchy notation for the
* rootline of the page ID.
*
* @param array $values Array of values, an array because of multivalued fields
@@ -70,7 +70,7 @@ class PageUidToHierarchy extends AbstractHierarchyProcessor implements FieldProc
foreach ($values as $value) {
list($rootPageUid, $mountPoint) = GeneralUtility::trimExplode(',',
$value, true, 2);
$results[] = $this->getSolrRootlineForPageId($rootPageUid,
$results[] = $this->getMeilisearchRootlineForPageId($rootPageUid,
$mountPoint);
}
@@ -78,18 +78,18 @@ class PageUidToHierarchy extends AbstractHierarchyProcessor implements FieldProc
}
/**
* Returns a Solr hierarchy notation string for rootline of given PID.
* Returns a Meilisearch hierarchy notation string for rootline of given PID.
*
* @param int $pageId Page ID to get a rootline as Solr hierarchy for
* @param int $pageId Page ID to get a rootline as Meilisearch hierarchy for
* @param string $mountPoint The mount point parameter that will be used for building the rootline.
* @return array Rootline as Solr hierarchy array
* @return array Rootline as Meilisearch hierarchy array
*/
protected function getSolrRootlineForPageId($pageId, $mountPoint = '')
protected function getMeilisearchRootlineForPageId($pageId, $mountPoint = '')
{
$pageIdRootline = $this->buildPageIdRootline($pageId, $mountPoint);
$solrRootline = $this->buildSolrHierarchyFromIdRootline($pageIdRootline);
$meilisearchRootline = $this->buildMeilisearchHierarchyFromIdRootline($pageIdRootline);
return $solrRootline;
return $meilisearchRootline;
}
/**

View File

@@ -46,7 +46,7 @@ class PathToHierarchy implements FieldProcessor
$results = [];
foreach ($values as $value) {
$valueResults = $this->buildSolrHierarchyFromPath($value);
$valueResults = $this->buildMeilisearchHierarchyFromPath($value);
$results = array_merge($results, $valueResults);
}
@@ -54,13 +54,13 @@ class PathToHierarchy implements FieldProcessor
}
/**
* Builds a Solr hierarchy from path string.
* Builds a Meilisearch hierarchy from path string.
*
* @param string $path path string
* @return array Solr hierarchy
* @see http://wiki.apache.org/solr/HierarchicalFaceting
* @return array Meilisearch hierarchy
* @see http://wiki.apache.org/meilisearch/HierarchicalFaceting
*/
protected function buildSolrHierarchyFromPath($path)
protected function buildMeilisearchHierarchyFromPath($path)
{
$hierarchy = [];
$path = HierarchyTool::substituteSlashes($path);

View File

@@ -29,11 +29,11 @@ use WapplerSystems\Meilisearch\FieldProcessor\PageUidToHierarchy;
use WapplerSystems\Meilisearch\FieldProcessor\PathToHierarchy;
use WapplerSystems\Meilisearch\FieldProcessor\TimestampToIsoDate;
use WapplerSystems\Meilisearch\FieldProcessor\TimestampToUtcIsoDate;
use WapplerSystems\Meilisearch\System\Solr\Document\Document;
use WapplerSystems\Meilisearch\System\Meilisearch\Document\Document;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Service class that modifies fields in a Apache Solr Document, used for
* Service class that modifies fields in a Meilisearch Document, used for
* common field processing during indexing or resolving
*
* @author Daniel Poetzinger <poetzinger@aoemedia.de>

View File

@@ -28,7 +28,7 @@ use WapplerSystems\Meilisearch\System\DateTime\FormatService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* A field processor that converts timestamps to ISO dates as needed by Solr
* A field processor that converts timestamps to ISO dates as needed by Meilisearch
*
* @author Ingo Renner <ingo@typo3.org>
*/
@@ -36,7 +36,7 @@ class TimestampToIsoDate implements FieldProcessor
{
/**
* Expects a timestamp and converts it to an ISO 8601 date as needed by Solr.
* Expects a timestamp and converts it to an ISO 8601 date as needed by Meilisearch.
*
* Example date output format: 1995-12-31T23:59:59Z
* The trailing "Z" designates UTC time and is mandatory

View File

@@ -28,7 +28,7 @@ use WapplerSystems\Meilisearch\System\DateTime\FormatService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* A field processor that converts timestamps to ISO dates as needed by Solr
* A field processor that converts timestamps to ISO dates as needed by Meilisearch
*
* @author Andreas Allacher <andreas.allacher@cyberhouse.at>
*/
@@ -36,7 +36,7 @@ class TimestampToUtcIsoDate implements FieldProcessor
{
/**
* Expects a timestamp and converts it to an ISO 8601 date in UTC as needed by Solr.
* Expects a timestamp and converts it to an ISO 8601 date in UTC as needed by Meilisearch.
*
* Example date output format: 1995-12-31T23:59:59Z
* The trailing "Z" designates UTC time and is mandatory