Important

You are browsing upcoming documentation for version 7.0 of OroCommerce, scheduled for release in 2026. Read the documentation for the latest LTS version to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

SearchApiAccessor 

SearchApiAccessorApiAccessor. Provides access to the search API for autocomplete functionality. This class is designed to be initialized based on server configuration.

Extends: ApiAccessor

Constructor Options 

Param

Type

Description

options

Object

Options container. See also options for ApiAccessor

options.search_handler_name

string

Name of the search handler to use

options.label_field_name

string

Name of the property that will be used as a label

options.value_field_name

string

Optional. Name of the property that will be used as an identifier. Defaults to ‘id’

Methods 

searchApiAccessor.prepareUrlParameters() 

Prepares URL parameters for the search API request.

Kind: instance method of SearchApiAccessor

searchApiAccessor.formatResult(response) ⇒ Object 

Formats the API response before it is returned from this accessor. Converts it into the following structure:

{
    results: [{id: '<value>', label: '<label>'}, ...],
    more: '<more>'
}

Kind: instance method of SearchApiAccessor

Param

Type

Description

response

Object

The response object returned by the search API