1
0
Fork 0

Update README.md (#183)

This commit is contained in:
Maxime 2017-05-29 08:44:07 +02:00 committed by GitHub
parent a656a5bc5c
commit bad44510af

View file

@ -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