How to limit the words in search api autocomplete suggestion? I have a requirement to limit the words to show up in row of autocomplete suggestion. Now its showing titles but problem is titles are too long and suggestions are covering entire width of the screen. So any way to limit it? I checked with HOOK_search_api_autocomplete_suggestions_alter hook but not getting what is the attribute to limit this feature. Any help will be appreciated.
Try below code, and you can trim $label as you want.

/**
 * Implements hook_search_api_autocomplete_suggestions_alter().
 */
function HOOK_search_api_autocomplete_suggestions_alter(array &amp;$suggestions, array $alter_params) {
  $used_labels = [];
  /** @var Drupal\search_api_autocomplete\Suggestion\Suggestion[] $suggestions */
  foreach ($suggestions as $key =&gt; $suggestion) {
    $suggestion-&gt;setUrl(NULL);
    $label = $suggestion-&gt;getLabel();
    $suggestion-&gt;setSuggestedKeys($label);
  }
}