# Interface: SearchBoxAdapter

# SearchBoxAdapter

interface

The Adapter of search box

## Methods

### createSuggestionElement

createSuggestionElement(suggestion) returns Element

Implement this method to override rendering of a suggestion.

| #### Parameter ||
|---|---|
| suggestion | Object A suggestion object from response Value must not be null. |

Returns

:   `non-null Element` element Element built based on a suggestion.

### decorateSuggestionElement

decorateSuggestionElement(element, suggestion)

Implement this method to decorate a suggestion, such as change CSS.

| #### Parameter ||
|---|---|
| element | Element Element you can decorate on Value must not be null. |
| suggestion | Object A suggestion object from response Value must not be null. |

### interceptSuggestRequest

interceptSuggestRequest(request) returns Object

Implement this method to add extra params in request.

| #### Parameter ||
|---|---|
| request | Object The original request Value must not be null. |

Returns

:   `non-null Object` request The updated request

### interceptSuggestResponse

interceptSuggestResponse(response)

Implement this method to read the suggest response prior to rendering. The
response object is read-only. If the call fails, the response
will contain the error.

If a new suggest request is issued while one is pending, the previous
request is cancelled and the method is not called.

| #### Parameter ||
|---|---|
| response | Object The suggest response Value must not be null. |