ItemSearchAutocompleteService

This service class contains functions for the autocompletion of the item search.
All public functions are available in the Twig template renderer.

Namespace

IO\Services

Properties
Type Name Description

UrlBuilderRepositoryContract

$urlBuilderRepository

LocalizationRepositoryContract

$localizationRepository

WebstoreConfiguration

$webstoreConfiguration

Methods
public __construct($urlBuilderRepository, $localizationRepository, $webstoreConfigurationRepository)

ItemSearchAutocompleteService constructor.

Parameters

Type

Name

Description

UrlBuilderRepositoryContract

$urlBuilderRepository

LocalizationRepositoryContract

$localizationRepository

WebstoreConfigurationRepositoryContract

$webstoreConfigurationRepository

public getDidYouMeanSuggestionSearchString($searchString, $suggestions):string

Gets a "Did you mean X?" string based on suggestions

Parameters

Type

Name

Description

string

$searchString

Original search string

array

$suggestions

Search suggestions based on search string

public getResults($searchString, $searchTypes):array

Get an item search result for the search string based on the chosen search types

Parameters

Type

Name

Description

string

$searchString

The search string

array

$searchTypes

What types of search to execute

public transformResult($itemSearchResult):array

Transform the item search result into a flatter format

Parameters

Type

Name

Description

array

$itemSearchResult

Raw item search result