にページごとのヒット数を設定する方法:<a href="https://github.com/algolia/autocomplete.js#hits" rel="nofollow noreferrer">it states</a>オートコンプリートのドキュメントでは、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
をすることになっているかわからないんだけど。私は3つのインデックスとinstantsearchのインスタンスを持っていますが、どちらかの指標を渡すと、次のエラー得られますでindexObj
結果を渡しながら
autocomplete.min.js?_=1494237458641:7 Uncaught TypeError: Cannot read property '_ua' of undefined
を:私は結果の数を制限する必要が
Uncaught ReferenceError: indexObj is not defined
示し、Iソースを渡す必要がありますが、私はそれを渡す方法を把握することはできません。
次の例に示すように、インデックスを生成する必要があります。https://github.com/algolia/autocomplete.js#standalone – rishipuri