Instantsearch.js 即时搜索结果开源项目

我要开发同款
匿名用户2015年11月23日
66阅读
开发技术JavaScript
所属分类jQueryUI框架、jQuery插件、jQuery UI框架
授权协议MIT

作品详情

Instantsearch.js是一个JavaScript库,它可以让你用 Algolia的RESTAPI创建一个即时搜索结果体验。

搜索结果的页面是由单个组件组成的,也被称为widgets。Widgets既是搜索输入的UI组件也是搜索输出的UI组件。

示例代码:

var instantsearch = require('instantsearch.js');// or use the 'instantsearch' global variable when using the jsDelivr buildvar search = instantsearch({  appId: appId, // Mandatory  apiKey: apiKey, // Mandatory  indexName: indexName, // Mandatory  numberLocale: 'fr-FR' // Optional, defaults to 'en-EN',  urlSync: { // optionnal, activate url sync if defined    useHash: false  }});// add a searchBox widgetsearch.addWidget(  instantsearch.widgets.searchBox({    container: '#search-box',    placeholder: 'Search for libraries in France...'  }));// add a hits widgetsearch.addWidget(  instantsearch.widgets.hits({    container: '#hits-container',    hitsPerPage: 10  }));// startsearch.start();

 

查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论