From bad44510aff7216cc4adf2a6b2b2dc127ef4f762 Mon Sep 17 00:00:00 2001 From: Maxime Date: Mon, 29 May 2017 08:44:07 +0200 Subject: [PATCH] Update README.md (#183) --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 121eb32f..45835d40 100644 --- a/README.md +++ b/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: '', + indexName: '', + inputSelector: '', + transformData: function (hits) { + // modify hits + return hits; + } +}); + ### Algolia options You can also pass any specific option to the Algolia API to change the way