According to the documentation on autocomplete, it mentions the following about hits:
Hits
To create a source based on Algolia's hits array, simply use:
{ source: autocomplete.sources.hits(indexObj, { hitsPerPage: 2 }), templates: { suggestion: function(suggestion, answer) { // FIXME } } }
However, I am unsure about the purpose of the indexObj
. I have an instantsearch instance with three indexes, but passing any index leads to the following error:
autocomplete.min.js?_=1494237458641:7 Uncaught TypeError: Cannot read property '_ua' of undefined
While passing indexObj
results in:
Uncaught ReferenceError: indexObj is not defined
I aim to limit the number of results displayed, and I believe passing the source should help achieve that, but I am unable to grasp how to pass it.