You are here

protected function LiveResults::isHighlightingAvailable in Search API Autocomplete 8

Checks whether the "highlight" processor is enabled for this index.

Return value

bool TRUE if the "highlight" processor is enabled for this index, FALSE otherwise.

2 calls to LiveResults::isHighlightingAvailable()
LiveResults::buildConfigurationForm in src/Plugin/search_api_autocomplete/suggester/LiveResults.php
Form constructor.
LiveResults::isHighlightingEnabled in src/Plugin/search_api_autocomplete/suggester/LiveResults.php
Checks whether highlighting is configured and available.

File

src/Plugin/search_api_autocomplete/suggester/LiveResults.php, line 246

Class

LiveResults
Provides a suggester plugin that displays live results.

Namespace

Drupal\search_api_autocomplete\Plugin\search_api_autocomplete\suggester

Code

protected function isHighlightingAvailable() : bool {
  try {
    return $this
      ->getSearch()
      ->getIndex()
      ->isValidProcessor('highlight');
  } catch (SearchApiAutocompleteException $e) {
    return FALSE;
  }
}