class SearchDriver implements ExtenderInterface

Methods

__construct(string $driverClass)

No description

addSearcher(string $modelClass, string $searcherClass)

Add a filter to this searcher. Filters are used to filter search queries.

addFilter(string $searcherClass, string $filterClass)

Add a filter to this searcher. Filters are used to filter search queries.

replaceFilter(string $searcherClass, string $replaceFilterClass, string $filterClass)

Replace a filter from this searcher. Filters are used to filter search queries.

setFulltext(string $searcherClass, string $fulltextClass)

Set the full text filter for this searcher. The full text filter actually executes the search.

addMutator(string $searcherClass, callable|string $callback)

Add a callback through which to run all search queries after filters have been applied.

void
extend(Container $container, Extension|null $extension = null)

No description

Details

__construct(string $driverClass)

Parameters

string $driverClass

SearchDriver addSearcher(string $modelClass, string $searcherClass)

Add a filter to this searcher. Filters are used to filter search queries.

Parameters

string $modelClass : The class of the model subject to searching/filtering. This model must extend \Flarum\Database\AbstractModel.
string $searcherClass : The class of the Searcher for this model This searcher must implement \Flarum\Search\SearcherInterface. Or extend \Flarum\Search\Database\AbstractSearcher if using the default driver.

Return Value

SearchDriver

SearchDriver addFilter(string $searcherClass, string $filterClass)

Add a filter to this searcher. Filters are used to filter search queries.

Parameters

string $searcherClass : The class of the Searcher for this model This searcher must implement \Flarum\Search\SearcherInterface. Or extend \Flarum\Search\Database\AbstractSearcher if using the default driver.
string $filterClass

Return Value

SearchDriver

SearchDriver replaceFilter(string $searcherClass, string $replaceFilterClass, string $filterClass)

Replace a filter from this searcher. Filters are used to filter search queries.

Parameters

string $searcherClass : The class of the Searcher for this model This searcher must implement \Flarum\Search\SearcherInterface. Or extend \Flarum\Search\Database\AbstractSearcher if using the default driver.
string $replaceFilterClass : The ::class attribute of the filter you are replacing.
string $filterClass : The ::class attribute of the filter you are adding. This filter must implement \Flarum\Search\FilterInterface

Return Value

SearchDriver

SearchDriver setFulltext(string $searcherClass, string $fulltextClass)

Set the full text filter for this searcher. The full text filter actually executes the search.

Parameters

string $searcherClass : The class of the Searcher for this model This searcher must implement \Flarum\Search\SearcherInterface. Or extend \Flarum\Search\Database\AbstractSearcher if using the default driver.
string $fulltextClass

Return Value

SearchDriver

SearchDriver addMutator(string $searcherClass, callable|string $callback)

Add a callback through which to run all search queries after filters have been applied.

Parameters

string $searcherClass : The class of the Searcher for this model This searcher must implement \Flarum\Search\SearcherInterface. Or extend \Flarum\Search\Database\AbstractSearcher if using the default driver.
callable|string $callback

Return Value

SearchDriver

void extend(Container $container, Extension|null $extension = null)

Parameters

Container $container
Extension|null $extension

Return Value

void