instantsearch.js

:zap: A JavaScript library for building performant and instant search experiences with Algolia.

Github星跟踪图


Version
License
Build Status
Pull reminders

InstantSearch.js is a vanilla JavaScript library that lets you create an instant-search result experience using Algolia’s search API. It is part of the InstantSearch family:

InstantSearch.js, React InstantSearch, Vue InstantSearch, Angular InstantSearch, React InstantSearch Native, InstantSearch Android, InstantSearch iOS

Why

You should be using InstantSearch if you want to:

  • Design search experiences with best practices
  • Customize your components at will
  • Remain independent from external frameworks

Getting started

Using InstantSearch.js is as simple as adding this JavaScript code to your page:

// 1. Instantiate the search
const search = instantsearch({
  indexName: 'instant_search',
  searchClient: algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'),
});

search.addWidgets([
  // 2. Create an interactive search box
  instantsearch.widgets.searchBox({
    container: '#searchbox',
    placeholder: 'Search for products',
  }),

  // 3. Plug the search results into the product container
  instantsearch.widgets.hits({
    container: '#products',
    templates: {
      item: '{{#helpers.highlight}}{ "attribute": "name" }{{/helpers.highlight}}',
    },
  }),

  // 4. Make the brands refinable
  instantsearch.widgets.refinementList({
    container: '#brand',
    attribute: 'brand',
  }),
]);

// 5. Start the search!
search.start();

To learn more about the library, follow the getting started guide or check how to add it to your own project.

Installation

npm install instantsearch.js algoliasearch
# or
yarn add instantsearch.js algoliasearch

Documentation

The documentation is available on the Algolia website.

Demos, E-commerce, Media, Travel, ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------, -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------, -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------, , , , See more demos on the website.

Playground

You can get to know InstantSearch.js on this playground.

Start by adding widgets and tweaking the display. Once you feel familiar with the library, we recommend following the getting started guide.

Browser support

We support the last two versions of major browsers (Chrome, Edge, Firefox, Safari).

Please refer to the browser support section in the documentation to use InstantSearch.js on other browsers.

Contributing

We welcome all contributors, from casual to regular ?

  • Bug report. Is something not working as expected? Send a bug report.
  • Feature request. Would you like to add something to the library? Send a feature request.
  • Documentation. Did you find a typo in the doc? Open an issue and we'll take care of it.
  • Development. If you don't know where to start, you can check the open issues that are tagged easy, the bugs or chores.

To start contributing to code, you need to:

  1. Fork the project
  2. Clone the repository
  3. Install the dependencies: yarn
  4. Run the development mode: yarn start
  5. Open the stories

Please read our contribution process to learn more.

License

InstantSearch.js is MIT licensed.

主要指标

概览
名称与所有者algolia/instantsearch
主编程语言TypeScript
编程语言JavaScript (语言数: 13)
平台
许可证MIT License
所有者活动
创建于2015-07-21 12:10:27
推送于2025-04-23 08:35:00
最后一次提交2025-04-23 10:34:58
发布数921
最新版本名称vue-instantsearch@4.20.6 (发布于 2025-03-24 08:59:05)
第一版名称v0.1.0 (发布于 )
用户参与
星数3.9k
关注者数132
派生数539
提交数11.5k
已启用问题?
问题数1894
打开的问题数135
拉请求数3545
打开的拉请求数24
关闭的拉请求数640
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?