Socket
Socket
Sign inDemoInstall

algoliasearch-helper

Package Overview
Dependencies
24
Maintainers
3
Versions
139
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    algoliasearch-helper

Helper for implementing advanced search features with algolia


Version published
Maintainers
3
Install size
829 kB
Created

Readme

Source

Coming from V1 (or js client v2)? Read the migration guide to the new version of the Helper.

algoliasearch-helper-js

This module is the companion of the algoliasearch-client-js. It helps you keep track of the search parameters and provides a higher level API.

The helper is built on top of algoliasearch-client-js and this version is specifically made to work with the newest V3 versions of it.

Features

  • Search parameters tracking
  • Facets exclusions
  • Pagination
  • Disjunctive facetting (search on two or more values for a single facet)

What does it look like?

A small example that uses Browserify to manage modules.

var algoliasearch = require( "algoliasearch" );
var algoliasearchHelper = require( "algoliasearch-helper" );

var client = algoliasearch( "app_id", "secret" );

var helper = algoliasearchHelper( client, "myMainIndex", { 
  facets : [ "mainCharacterFirstName", "year" ],
  disjunctiveFacets : [ "director" ]
});

helper.on( "result", function( data ){
  console.log( data.hits );
} );

helper.addDisjunctiveRefine( "director", "Clint Eastword" );
helper.addDisjunctiveRefine( "director", "Sofia Coppola" );

helper.addNumericRefine( "year", "=", 2003 );

// Search for any movie filmed in 2003 and directed by either C. Eastwood or S. Coppola
helper.search();

How to use this module

Have a look at the JSDoc

See the examples in action

Use with NPM

npm install algoliasearch-helper

Use with bower

bower install algoliasearch-helper

Use the CDN

Include this in your page :

<script src="//cdn.jsdelivr.net/algoliasearch.helper/2.0.0/algoliasearch.helper.min.js"></script>

How to contribute

  • fork this repo
  • clone the repository git clone https://github.com/[your-handle-here]/algoliasearch-helper-js.git
  • make your fix or feature
  • launch the dev mode npm run dev
  • add a test for your feature (see /test folder)
  • make sure, it goes through the linter without an error npm run lint
  • propose your pull request
  • profit :)

A quick note though, even though we'll make our best to read and integrate your PR, we may be a bit slow. Sorry :). We might also make some comments and discussions too, for the best interest of this library. Thanks in advance for your contribution!

FAQs

Last updated on 13 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc