73 lines
2.0 KiB
PHP
73 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace KupShop\CatalogBundle\Search;
|
|
|
|
use KupShop\CatalogBundle\Search\Exception\FulltextException;
|
|
|
|
interface FulltextInterface
|
|
{
|
|
public function setCurlTimeout($timeout): self;
|
|
|
|
public function getIndexTypes(): array;
|
|
|
|
public function search(string $term, array $config, array $types = []): array;
|
|
|
|
public function searchProducts($term, $count, $offset, $order = null, $filter = '');
|
|
|
|
public function searchProductsExact($term, $count, $offset, $order = null, $filter = '');
|
|
|
|
public function getRowsCount();
|
|
|
|
public function suggestTerm($term);
|
|
|
|
public function updateProduct($id_product);
|
|
|
|
/**
|
|
* Loads synonyms from settings.
|
|
*
|
|
* @return array synonyms
|
|
*/
|
|
public function loadSynonyms(): array;
|
|
|
|
/**
|
|
* Loads synonyms from index settings.
|
|
*
|
|
* @deprecated use {@see FulltextInterface::loadSynonyms()}
|
|
*/
|
|
public function loadSynonymsFromIndex(): ?array;
|
|
|
|
/**
|
|
* Saves synonyms into settings and
|
|
* puts them into indices.
|
|
*
|
|
* @param array $synonyms synonyms to save into settings
|
|
* @param bool $merge true -> merge already existing synonyms with the ones
|
|
* passed in $synonyms argument
|
|
*/
|
|
public function updateSynonyms(array $synonyms, bool $merge = false): void;
|
|
|
|
/**
|
|
* Saves synonyms into settings.
|
|
*/
|
|
public function saveSynonyms(array $synonyms): void;
|
|
|
|
/**
|
|
* Recreates specified index. If $type === 'all' -> recreates all indices. <br>
|
|
* Permitted types: {@see FulltextElastic::INDEX_TYPES}.
|
|
*
|
|
* @throws FulltextException
|
|
*/
|
|
public function updateIndex(string $type = 'all', $clean = true, array $exceptTypes = []): void;
|
|
|
|
/**
|
|
* Temporary for LuigisBox. Maybe in future implemented by Elastic as well.
|
|
*/
|
|
public function supportsFilters(): bool;
|
|
|
|
public function getFilters(): array;
|
|
|
|
public function setDynamicFilters(array $filters): void;
|
|
|
|
public function getFulltextLanguages(): array;
|
|
}
|