---
Added: v2.0.0
Status: Active
---
# Search component
Searches items for supplied search terms.
## Basic usage
```html
```
## Class members
### Properties
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
| displayWith | `function | null` | null | Function that maps an option's value to its display value in the trigger. |
| maxResults | `number` | 20 | Maximum number of results to show in the search. |
| queryBody | `QueryBody` | | **Deprecated:** in 2.1.0 |
| searchTerm | `string` | "" | Search term to use when executing the search. Updating this value will run a new search and update the results. |
| skipResults | `number` | 0 | Number of results to skip from the results pagination. |
| class | `` | | CSS class for display. |
### Events
| Name | Type | Description |
| -- | -- | -- |
| error | `EventEmitter` | Emitted when an error occurs. |
| resultLoaded | `EventEmitter` | Emitted when search results have fully loaded. |
## Details
### Customise Search Results
You have to add a template that will be shown when the results are loaded.
```html
{{ item?.entry.name }}
```
The results are provided via the [$implicit variable of angular2](https://angular.io/api/common/NgTemplateOutlet) and can be accessed via the sugar sintax 'let-yourChosenName'. As per example above the result will be something like :

But you can define even a more complex template :
```html
```
Which will look like :

### Attach an input field to the search
You can also attach your input field to the adf-search component via the trigger [searchAutocomplete]
Yuo can do this by exporting the adf-search panel instance into a local template variable (here we called it "search"), and binding that variable to the input's searchAutocomplete property.
```html
{{ item?.entry.name }}
```
In this way it is possible to fetch the results from the word typed into the input text straight into the adf-search component via the custom template variable.
### Custom search configuration
You can get finer control over the parameters of a search by defining them in a custom
[QueryBody](https://github.com/Alfresco/alfresco-js-api/blob/1.6.0/src/alfresco-search-rest-api/docs/QueryBody.md)
object. The recommended way to do this is with a custom implementation of the
[Search Configuration interface](../core/search-configuration.interface.md) (the `queryBody` parameter of the `Search component` is now deprecated). The ADF source provides a standard implementation of this
interface, `SearchConfigurationService` that you can use as a base to adapt to your needs. See the
[Search Configuration interface](../core/search-configuration.interface.md) page for full details of how to
customize your search.
## See Also
- [Search configuration interface](../core/search-configuration.interface.md)
- [Search configuration service](../core/search-configuration.service.md)