Update README.md (#183)
This commit is contained in:
parent
a656a5bc5c
commit
bad44510af
1 changed files with 20 additions and 0 deletions
20
README.md
20
README.md
|
|
@ -184,6 +184,11 @@ search.autocomplete.on('autocomplete:opened', function(e) {
|
|||
});
|
||||
```
|
||||
|
||||
### Docsearch Options
|
||||
|
||||
|
||||
#### handleSelected
|
||||
|
||||
We already bind the autocomplete:selected event inside the docsearch.
|
||||
If you want to replace the default behavior you can pass the `handleSelected` option.
|
||||
|
||||
|
|
@ -197,6 +202,21 @@ var search = docsearch({
|
|||
});
|
||||
```
|
||||
|
||||
#### transformData
|
||||
|
||||
If you want to modify the hits before displaying them you can make use of the
|
||||
`transformData` option
|
||||
|
||||
var search = docsearch({
|
||||
apiKey: '<API_KEY>',
|
||||
indexName: '<INDEX_NAME>',
|
||||
inputSelector: '<YOUR_INPUT_DOM_SELECTOR>',
|
||||
transformData: function (hits) {
|
||||
// modify hits
|
||||
return hits;
|
||||
}
|
||||
});
|
||||
|
||||
### Algolia options
|
||||
|
||||
You can also pass any specific option to the Algolia API to change the way
|
||||
|
|
|
|||
Loading…
Reference in a new issue