public function FuzzysearchExcerpt::supportsIndex in Fuzzy Search 7
Check whether this processor is applicable for a certain index.
This can be used for hiding the processor on the index's "Filters" tab. To avoid confusion, you should only use criteria that are immutable, such as the index's item type. Also, since this is only used for UI purposes, you should not completely rely on this to ensure certain index configurations and at least throw an exception with a descriptive error message if this is violated on runtime.
Parameters
SearchApiIndex $index: The index to check for.
Return value
boolean TRUE if the processor can run on the given index; FALSE otherwise.
Overrides SearchApiAbstractProcessor::supportsIndex
File
- includes/
processor_excerpt.inc, line 16 - File for processor excerpt.
Class
- FuzzysearchExcerpt
- Processor to set the index and search settings. Requires FuzzySearchService.
Code
public function supportsIndex(SearchApiIndex $index) {
return $index
->server() && $index
->server()
->supportsFeature('fuzzysearch');
}