0
设置每页安打自动完成的文档,it states:如何在Algolia自动完成
Hits
To build a source based on Algolia's hits array, just use:
{ source: autocomplete.sources.hits(indexObj, { hitsPerPage: 2 }), templates: { suggestion: function(suggestion, answer) { // FIXME } } }
但是,我不知道什么是idexObj
应该是。我有instantsearch与三个指标的实例,但传球无论是指数提供了以下错误:
autocomplete.min.js?_=1494237458641:7 Uncaught TypeError: Cannot read property '_ua' of undefined
,同时通过indexObj
结果:
Uncaught ReferenceError: indexObj is not defined
我需要限制结果的数量显示和我假设通过源代码应该这样做,但我无法弄清楚如何传递它。
您需要生成如下例所示的索引:https://github.com/algolia/autocomplete.js#standalone – rishipuri