# Search Results component - [Basic usage](#basic-usage) * [Properties](#properties) * [Events](#events) - [Details](#details) ## Basic usage ```html ``` ### Properties | Name | Type | Default | Description | | --- | --- | --- | --- | | searchTerm | string | | Search term to use when executing the search. Updating this value will run a new search and update the results | | rootNodeId | string | "-root-" | NodeRef or node name where the search should start. | | resultType | string | | Node type to filter search results by, e.g. 'cm:content', 'cm:folder' if you want only the files. | | maxResults | number | 20 | Maximum number of results to show in the search. | | resultSort | string | | Criteria to sort search results by, must be one of "name" , "modifiedAt" or "createdAt" | | displayWith | function | | Function that maps an option's value to its display value in the trigger | ### Events | Name | Description | | --- | --- | | resultLoaded | 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 ``` 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 : ![adf-search-control](docassets/images/search-component-simple-template.png) But you can define even a more complex template : ```html

{{ item?.entry.name }}

{{item?.entry.createdByUser.displayName}}

{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}

``` Which will look like : ![adf-search-control](docassets/images/search-component-complex-template.png) ### Attach an input field to the search You can also attach your input field to the adf-search component via the trigger [searchAutocomplete] ```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.