• This repository has been archived on 11/Jul/2023
  • Stars
    star
    174
  • Rank 211,222 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Helper for implementing advanced search features with Algolia

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

Coming from V2? Read the migration guide to the new version of the Helper.

The JavaScript helper is an advanced library we provide to our users. If you are looking to build a complete search interface, we recommend you to use instantsearch.js. If you want to build an autocomplete menu, see autocomplete.js.

algoliasearch-helper-js

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

See the helper in action

Version Build Status License Downloads jsDelivr Hits

Features

  • Search parameters management
  • Facets exclusions
  • Pagination
  • Disjunctive faceting (search on two or more values of the same facet)

Examples

Vanilla JavaScript

A small example that uses Browserify to manage modules.

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

var client = algoliasearch('appId', 'apiKey');

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

helper.on('result', function(event){
  console.log(event.results);
});

helper.addDisjunctiveFacetRefinement('director', 'Clint Eastwood');
helper.addDisjunctiveFacetRefinement('director', 'Sofia Coppola');

helper.addNumericRefinement('year', '=', 2003);

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

See more examples in the examples folder

AngularJS module

<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.angular.js"></script>
<script src="dist/algoliasearch.helper.min.js"></script>

<script type="text/javascript">
angular.module('searchApp', ['ngSanitize', 'algoliasearch'])
.controller('searchController', ['$scope', '$sce', 'algolia', function($scope, $sce, algolia) {
  var algolia = algolia.Client('applicationId', 'apiKey');
  $scope.q = '';
  $scope.content = null;
  $scope.helper = algoliasearchHelper(algolia, 'indexName', {
    facets: ['type', 'shipping'],
    disjunctiveFacets: ['category', 'manufacturer'],
    hitsPerPage: 5,
  });
  $scope.helper.on('result', function(event) {
    $scope.$apply(function() {
      $scope.content = event.results;
    });
  });
  $scope.toggleRefine = function($event, facet, value) {
    $event.preventDefault();
    $scope.helper.toggleRefine(facet, value).search();
  };
  $scope.$watch('q', function(q) {
    $scope.helper.setQuery(q).search();
  });
  $scope.helper.search();
}]);
</script>

You can see the full Angular example here

Helper cheatsheet

There is also a complete JSDoc

Add the helper in your project

Regular <script> tag

Use our jsDelivr build:

<script src="https://cdn.jsdelivr.net/algoliasearch.helper/2/algoliasearch.helper.min.js"></script>

With npm

npm install algoliasearch-helper

Init the helper

var helper = algoliasearchHelper(client, 'indexName'/*, parameters*/);

Helper lifecycle

  1. modify the parameters of the search (usually through user interactions)
    helper.setQuery('iphone').addFacetRefinement('category', 'phone')

  2. trigger the search (after all the modification have been applied)
    helper.search()

  3. read the results (with the event "result" handler) and update the UI with the results
    helper.on('result', function(event) { updateUI(event.results); });

  4. go back to 1

Objects

AlgoliasearchHelper: the helper. Keeps the state of the search, makes the queries and calls the handlers when an event happen.

SearchParameters: the object representing the state of the search. The current state is stored in helperInstance.state.

SearchResults: the object in which the Algolia answers are transformed into. This object is passed to the result event handler. An example of SearchResults in JSON is available at the end of this readme

Search

The search is triggered by the search() method.

It takes all the previous modifications to the search and uses them to create the queries to Algolia. The search parameters are immutable.

Example:

var helper = algoliasearchHelper(client, indexName);

// Let's monitor the results with the console
helper.on('result', function(event) {
  console.log(event.results);
});

// Let's make an empty search
// The results are all sorted using the dashboard configuration
helper.search();

// Let's search for "landscape"
helper.setQuery('landscape').search();

// Let's add a category "photo"
// Will make a search with "photo" tag and "landscape" as the query
helper.addTag('photo').search();

Events

The helper is a Node.js EventEmitter instance.

result: get notified when new results are received. The handler function will receive two objects (SearchResults and SearchParameters).

error: get notified when errors are received from the API.

change: get notified when a property has changed in the helper

search : get notified when a request is sent to Algolia

Listen to the result event

helper.on('result', updateTheResults);

Listen to a result event once

helper.once('result', updateTheResults);

Remove a result listener

helper.removeListener('result', updateTheResults);

Remove all result listeners

helper.removeAllListeners('result');

All the methods from Node.js EventEmitter class are available.

Query

Do a search with the query "fruit"

helper.setQuery('fruit').search();

Filtering results

Facets are filters to retrieve a subset of an index having a specific value for a given attribute. First you need to define which attribute will be used as a facet in the dashboard: https://www.algolia.com/explorer#?tab=display

Regular (conjunctive) facets

Refinements are ANDed by default (Conjunctive selection).

Facet definition
var helper = algoliasearchHelper(client, indexName, {
	facets: ['ANDFacet']
});
Add a facet filter
helper.addFacetRefinement('ANDFacet', 'valueOfANDFacet').search();
Remove a facet filter
helper.removeFacetRefinement('ANDFacet', 'valueOfANDFacet').search();

Disjunctive facets

Refinements are ORed by default (Disjunctive selection).

Facet definition
var helper = algoliasearchHelper(client, indexName, {
	disjunctiveFacets: ['ORFacet']
});
Add a facet filter
helper.addDisjunctiveFacetRefinement('ORFacet', 'valueOfORFacet').search();
Remove a facet filter
helper.removeDisjunctiveFacetRefinement('ORFacet', 'valueOfORFacet').search();

Negative facets

Filter so that we do NOT get a given facet

Facet definition (same as "AND" facet)
var helper = algoliasearchHelper(client, indexName, {
	facets: ['ANDFacet']
}).search();
Exclude a value for a facet
helper.addFacetExclusion('ANDFacet', 'valueOfANDFacetToExclude');
Remove an exclude from the list of excluded values
helper.removeFacetExclusion('ANDFacet', 'valueOfANDFacetToExclude');

Numeric facets

Filter over numeric attributes with math operations like =, >, <, >=, <=. Can be used for numbers and dates (if converted to timestamp)

Facet definition
var helper = algoliasearchHelper(client, indexName, {
  disjunctiveFacets: ['numericAttribute']
});
Add numeric refinements
helper.addNumericRefinement('numericAttribute', '=', '3').search();
// filter to only the results that match numericAttribute=3
helper.addNumericRefinement('numericAttribute', '=', '4').search();
// filter to only the results that match numericAttribute=3 AND numericAttribute=4

// On another numeric with no previous filter
helper.addNumericRefinement('numericAttribute2', '=', ['42', '56', '37'] ).search();
// filter to only the results that match numericAttribute2=42 OR numericAttribute2=56 OR numericAttribute2=37
Remove a numeric refinement
helper.removeNumericRefinement('numericAttribute', '=', '3').search();
Batch numeric filter removal
// for the single operator = on numericAttribute
helper.removeNumericRefinement('numericAttribute', '=').search();
// for all the refinements on numericAttribute
helper.removeNumericRefinement('numericAttribute').search();

Hierarchical facets

Hierarchical facets are useful to build such navigation menus:

| products
  > fruits
    > citrus
    | strawberries
    | peaches
    | apples

Here, we refined the search this way:

  • click on fruits
  • click on citrus
Usage

To build such menu, you need to use hierarchical faceting:

var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1']
  }]
});

Requirements: All the specified attributes must be defined in your Algolia settings as attributes for faceting.

Given your objects looks like this:

{
  "objectID": "123",
  "name": "orange",
  "categories": {
    "lvl0": "fruits",
    "lvl1": "fruits > citrus"
  }
}

And you refine products:

helper.toggleFacetRefinement('products', 'fruits > citrus');

You will get a hierarchical presentation of your facet values: a navigation menu of your facet values.

helper.on('result', function(event){
  console.log(event.results.hierarchicalFacets[0]);
  // {
  //   'name': 'products',
  //   'count': null,
  //   'isRefined': true,
  //   'path': null,
  //   'data': [{
  //     'name': 'fruits',
  //     'path': 'fruits',
  //     'count': 1,
  //     'isRefined': true,
  //     'data': [{
  //       'name': 'citrus',
  //       'path': 'fruits > citrus',
  //       'count': 1,
  //       'isRefined': true,
  //       'data': null
  //     }]
  //   }]
  // }
});

To ease navigation, we always:

  • provide the root level categories
  • provide the current refinement sub categories (fruits > citrus > *: n + 1)
  • provide the parent refinement (fruits > citrus => fruits: n -1) categories
  • refine the search using the current hierarchical refinement
Multiple values per level

Your records can also share multiple categories between one another by using arrays inside your object:

{
  "objectID": "123",
  "name": "orange",
  "categories": {
    "lvl0": ["fruits", "color"],
    "lvl1": ["fruits > citrus", "color > orange"]
  }
},
{
  "objectID": "456",
  "name": "grapefruit",
  "categories": {
    "lvl0": ["fruits", "color", "new"],
    "lvl1": ["fruits > citrus", "color > yellow", "new > citrus"]
  }
}
Specifying another separator
var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1'],
    separator: '|'
  }]
});

helper.toggleFacetRefinement('products', 'fruits|citrus');

Would mean that your objects look like so:

{
  "objectID": "123",
  "name": "orange",
  "categories": {
    "lvl0": "fruits",
    "lvl1": "fruits|citrus"
  }
}
Specifying a different sort order for values

The default sort for the hierarchical facet view is: isRefined:desc (first show refined), name:asc (then sort by name).

You can specify a different sort order by using:

var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1'],
    sortBy: ['count:desc', 'name:asc'] // first show the most common values, then sort by name
  }]
});

The available sort tokens are:

  • count
  • isRefined
  • name
  • path
Restrict results and hierarchical values to non-root level

Let's say you have a lot of levels:

- fruits
  - yellow
    - citrus
      - spicy

But you only want to get the values starting at "citrus", you can use rootPath

You can specify an root path to filter the hierarchical values

var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1', 'categories.lvl2', 'categories.lvl3'],
    rootPath: 'fruits > yellow > citrus'
  }]
});

Having a rootPath will refine the results on it automatically.

Hide parent level of current parent level

By default the hierarchical facet is going to return the child and parent facet values of the current refinement.

If you do not want to get the parent facet values you can set showParentLevel to false

var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1'],
    showParentLevel: false
  }]
});
Asking for the current breadcrumb
var helper = algoliasearchHelper(client, indexName, {
  hierarchicalFacets: [{
    name: 'products',
    attributes: ['categories.lvl0', 'categories.lvl1'],
    separator: '|'
  }]
});

helper.toggleFacetRefinement('products', 'fruits|citrus');
var breadcrumb = helper.getHierarchicalFacetBreadcrumb('products');

console.log(breadcrumb);
// ['fruits', 'citrus']

console.log(breadcrumb.join(' | '));
// 'fruits | citrus'

Clearing filters

Clear all the refinements for all the refined attributes
helper.clearRefinements().search();
Clear all the refinements for a specific attribute
helper.clearRefinements('ANDFacet').search();
[ADVANCED] Clear only the exclusions on the "ANDFacet" attribute
helper.clearRefinements(function(value, attribute, type) {
  return type === 'exclude' && attribute === 'ANDFacet';
}).search();

Facet utilities

Get the values of a facet with the default sort

helper.on('result', function(event) {
  // Get the facet values for the attribute age
  event.results.getFacetValues('age');
  // It will be ordered :
  //  - refined facets first
  //  - then ordered by number of occurence (bigger count -> higher in the list)
  //  - then ordered by name (alphabetically)
});

Get the values of a facet with a custom sort

helper.on('result', function(event) {
  // Get the facet values for the attribute age
  event.results.getFacetValues('age', {sortBy: ['count:asc']});
  // It will be ordered by number of occurence (lower number => higher position)
  // Elements that can be sorted : count, name, isRefined
  // Type of sort : 'asc' for ascending order, 'desc' for descending order
});

Get the facet stats

This only apply on numeric based facets/attributes.

helper.on('result', function(event) {
  // Get the facet values for the attribute age
  event.results.getFacetStats('age');
});

Tags

Tags are an easy way to do filtering. They are based on a special attribute in the records named _tags, which can be a single string value or an array of strings.

Add a tag filter for the value "landscape"

helper.addTag('landscape').search();

Remove a tag filter for the value "landscape"

helper.removeTag('landscape').search();

Clear all the tags filters

helper.clearTags().search();

Pagination

Get the current page

helper.getPage();

Change page

helper.setPage(3).search();

Automatic reset to page 0

During a search, changing the parameters will update the result set, which can then change the number of pages in the result set. Therefore, the behavior has been standardized so that any operation that may change the number of page will reset the pagination to page 0.

This may lead to some unexpected behavior. For example:

helper.setPage(4);
helper.getPage(); // 4
helper.setQuery('foo');
helper.getPage(); // 0

Non exhaustive list of operations that trigger a reset:

  • refinements (conjunctive, exclude, disjunctive, hierarchical, numeric)
  • tags
  • index (setIndex)
  • setQuery
  • setHitsPerPage
  • setTypoTolerance

Index

Index can be changed. The common use case is when you have several slaves with different sort order (sort by relevance, price or any other attribute).

Change the current index

helper.setIndex('index_orderByPrice').search();

Get the current index

var currentIndex = helper.getIndex();

One time query

Sometime it's convenient to reuse the current search parameters with small changes without changing the state stored in the helper. That's why there is a function called searchOnce. This method does not trigger change or error events.

In the following, we are using searchOnce to fetch only a single element using all the other parameters already set in the search parameters.

Using searchOnce with a callback

var state = helper.searchOnce(
  {hitsPerPage: 1},
  function(error, content, state) {
    // if an error occured it will be passed in error, otherwise its value is null
    // content contains the results formatted as a SearchResults
    // state is the instance of SearchParameters used for this search
  });

Using searchOnce with a promise

var state1 = helper.searchOnce({hitsPerPage: 1})
                   .then(function(res) {
  // res contains
  // {
  //   content : SearchResults
  //   state : SearchParameters (the one used for this specific search)
  // }
});

Query parameters

There are lots of other parameters you can set.

Set a parameter at the initialization of the helper

var helper = algoliasearchHelper(client, indexName, {
	hitsPerPage: 50
});

Set a parameter later

helper.setQueryParameter('hitsPerPage', 20).search();

List of parameters that can be set

Name

Type

Description

advancedSyntax

boolean

Enable the advanced syntax.

advancedSyntax on Algolia.com

allowTyposOnNumericTokens

boolean

Should the engine allow typos on numerics.

allowTyposOnNumericTokens on Algolia.com

analytics

boolean

Enable the analytics

analytics on Algolia.com

analyticsTags

string

Tag of the query in the analytics.

analyticsTags on Algolia.com

aroundLatLng

string

Center of the geo search.

aroundLatLng on Algolia.com

aroundLatLngViaIP

boolean

Center of the search, retrieve from the user IP.

aroundLatLngViaIP on Algolia.com

aroundPrecision

number

Precision of the geo search.

aroundPrecision on Algolia.com

aroundRadius

number

Radius of the geo search.

aroundRadius on Algolia.com

minimumAroundRadius

number

Minimum radius of the geo search.

minimumAroundRadius on Algolia.com

attributesToHighlight

string

List of attributes to highlight

attributesToHighlight on Algolia.com

attributesToRetrieve

string

List of attributes to retrieve

attributesToRetrieve on Algolia.com

attributesToSnippet

string

List of attributes to snippet

attributesToSnippet on Algolia.com

disjunctiveFacets

Array.<string>

All the declared disjunctive facets

distinct

boolean|number

Remove duplicates based on the index setting attributeForDistinct

distinct on Algolia.com

facets

Array.<string>

All the facets that will be requested to the server

filters

string

Add filters to the query (similar to WHERE clauses)

filters on Algolia.com

getRankingInfo

integer

Enable the ranking informations in the response

getRankingInfo on Algolia.com

hitsPerPage

number

Number of hits to be returned by the search API

hitsPerPage on Algolia.com

ignorePlurals

boolean

Should the plurals be ignored

ignorePlurals on Algolia.com

insideBoundingBox

string

Geo search inside a box.

insideBoundingBox on Algolia.com

insidePolygon

string

Geo search inside a polygon.

insidePolygon on Algolia.com

maxValuesPerFacet

number

Number of values for each facetted attribute

maxValuesPerFacet on Algolia.com

minWordSizefor1Typo

number

Number of characters to wait before doing one character replacement.

minWordSizefor1Typo on Algolia.com

minWordSizefor2Typos

number

Number of characters to wait before doing a second character replacement.

minWordSizefor2Typos on Algolia.com

optionalWords

string

Add some optional words to those defined in the dashboard

optionalWords on Algolia.com

page

number

The current page number

page on Algolia.com

query

string

Query string of the instant search. The empty string is a valid query.

query on Algolia.com

queryType

string

How the query should be treated by the search engine. Possible values: prefixAll, prefixLast, prefixNone

queryType on Algolia.com

removeWordsIfNoResults

string

Possible values are "lastWords" "firstWords" "allOptional" "none" (default)

removeWordsIfNoResults on Algolia.com

replaceSynonymsInHighlight

boolean

Should the engine replace the synonyms in the highlighted results.

replaceSynonymsInHighlight on Algolia.com

restrictSearchableAttributes

string

Restrict which attribute is searched.

restrictSearchableAttributes on Algolia.com

synonyms

boolean

Enable the synonyms

synonyms on Algolia.com

tagFilters

string

Contains the tag filters in the raw format of the Algolia API. Setting this parameter is not compatible with the of the add/remove/toggle methods of the tag api.

tagFilters on Algolia.com

typoTolerance

string

How the typo tolerance behave in the search engine. Possible values: true, false, min, strict

typoTolerance on Algolia.com

Results format

Here is an example of a result object you get with the result event.

{
   "hitsPerPage": 10,
   "processingTimeMS": 2,
   "facets": [
      {
         "name": "type",
         "data": {
            "HardGood": 6627,
            "BlackTie": 550,
            "Music": 665,
            "Software": 131,
            "Game": 456,
            "Movie": 1571
         },
         "exhaustive": false
      },
      {
         "exhaustive": false,
         "data": {
            "Free shipping": 5507
         },
         "name": "shipping"
      }
   ],
   "hits": [
      {
         "thumbnailImage": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif",
         "_highlightResult": {
            "shortDescription": {
               "matchLevel": "none",
               "value": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection",
               "matchedWords": []
            },
            "category": {
               "matchLevel": "none",
               "value": "Computer Security Software",
               "matchedWords": []
            },
            "manufacturer": {
               "matchedWords": [],
               "value": "Webroot",
               "matchLevel": "none"
            },
            "name": {
               "value": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows",
               "matchedWords": [],
               "matchLevel": "none"
            }
         },
         "image": "http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg",
         "shipping": "Free shipping",
         "bestSellingRank": 4,
         "shortDescription": "Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection",
         "url": "http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-deviโ€ฆd=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ",
         "name": "Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows",
         "category": "Computer Security Software",
         "salePrice_range": "1 - 50",
         "objectID": "1688832",
         "type": "Software",
         "customerReviewCount": 5980,
         "salePrice": 49.99,
         "manufacturer": "Webroot"
      },
      ....
   ],
   "nbHits": 10000,
   "disjunctiveFacets": [
      {
         "exhaustive": false,
         "data": {
            "5": 183,
            "12": 112,
            "7": 149,
            ...
         },
         "name": "customerReviewCount",
         "stats": {
            "max": 7461,
            "avg": 157.939,
            "min": 1
         }
      },
      {
         "data": {
            "Printer Ink": 142,
            "Wireless Speakers": 60,
            "Point & Shoot Cameras": 48,
            ...
         },
         "name": "category",
         "exhaustive": false
      },
      {
         "exhaustive": false,
         "data": {
            "> 5000": 2,
            "1 - 50": 6524,
            "501 - 2000": 566,
            "201 - 500": 1501,
            "101 - 200": 1360,
            "2001 - 5000": 47
         },
         "name": "salePrice_range"
      },
      {
         "data": {
            "Dynexโ„ข": 202,
            "Insigniaโ„ข": 230,
            "PNY": 72,
            ...
         },
         "name": "manufacturer",
         "exhaustive": false
      }
   ],
   "query": "",
   "nbPages": 100,
   "page": 0,
   "index": "bestbuy"
}

Browser support

This project works on any ES5 browser, basically >= IE9+.

More Repositories

1

places

๐ŸŒ Turn any <input> into an address autocomplete
JavaScript
5,372
star
2

autocomplete

๐Ÿ”ฎ Fast and full-featured autocomplete library
TypeScript
4,668
star
3

docsearch

๐Ÿ“˜ The easiest way to add search to your documentation.
TypeScript
3,748
star
4

instantsearch

โšก๏ธ Libraries for building performant and instant search experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
TypeScript
3,468
star
5

react-instantsearch

โšก๏ธ Lightning-fast search for React and React Native applications, by Algolia.
TypeScript
1,973
star
6

algoliasearch-client-javascript

โšก๏ธ A fully-featured and blazing-fast JavaScript API client to interact with Algolia.
TypeScript
1,259
star
7

github-awesome-autocomplete

:octocat: Add instant search capabilities to GitHub's search bar
JavaScript
1,062
star
8

vue-instantsearch

๐Ÿ‘€ Algolia components for building search UIs with Vue.js
JavaScript
856
star
9

shipjs

Take control of what is going to be your next release.
JavaScript
749
star
10

awesome-algolia

๐Ÿ”๐Ÿ‘‹ START HERE! A curated list of Algolia libraries, resources and projects.
681
star
11

algoliasearch-client-php

โšก๏ธ A fully-featured and blazing-fast PHP API client to interact with Algolia.
PHP
661
star
12

instantsearch-ios

โšก๏ธ A library of widgets and helpers to build instant-search applications on iOS.
Swift
573
star
13

voice-overlay-ios

๐Ÿ—ฃ An overlay that gets your userโ€™s voice permission and input as text in a customizable UI
Swift
535
star
14

hn-search

Hacker News Search
TypeScript
489
star
15

react-element-to-jsx-string

Turn a ReactElement into the corresponding JSX string
JavaScript
478
star
16

docsearch-configs

DocSearch - Configurations
JavaScript
454
star
17

sup3rS3cretMes5age

Simple to use, simple to deploy, one time self destruct messaging service, with hashicorp vault as a backend
Go
445
star
18

expect-jsx

โœ… toEqualJSX for expect assertion library
JavaScript
410
star
19

algoliasearch-rails

AlgoliaSearch integration to your favorite ORM
Ruby
398
star
20

scout-extended

Scout Extended: The Full Power of Algolia in Laravel
PHP
382
star
21

algoliasearch-wordpress

โŒ๐Ÿ—‘๐Ÿ™…โ€โ™‚๏ธ Algolia Search plugin for WordPress is no longer supported. Please use our API client guide instead
JavaScript
355
star
22

docsearch-scraper

DocSearch - Scraper
Python
293
star
23

color-extractor

Extract the dominant color(s) of your fashion articles!
Python
271
star
24

algoliasearch-netlify

Official Algolia Plugin for Netlify. Index your website to Algolia when deploying your project to Netlify with the Algolia Crawler
TypeScript
260
star
25

angular-instantsearch

โšก๏ธLightning-fast search for Angular apps, by Algolia
TypeScript
255
star
26

voice-overlay-android

๐Ÿ—ฃ An overlay that gets your userโ€™s voice permission and input as text in a customizable UI
Kotlin
243
star
27

algoliasearch-laravel

[Deprecated] We now recommend using Laravel Scout, see =>
PHP
239
star
28

jekyll-algolia

Add fast and relevant search to your Jekyll site
Ruby
211
star
29

algoliasearch-client-swift

โšก๏ธ A fully-featured and blazing-fast Swift API client to interact with Algolia.
Swift
203
star
30

algoliasearch-client-go

โšก๏ธ A fully-featured and blazing-fast Go API client to interact with Algolia.
Go
193
star
31

algoliasearch-client-python

โšก๏ธ A fully-featured and blazing-fast Python API client to interact with Algolia.
Python
192
star
32

search-bundle

Seamless integration of Algolia Search into your Symfony project.
PHP
191
star
33

atom-autocomplete-module-import

โš›๏ธ Search & install npm packages from import/require statements.
JavaScript
182
star
34

gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
JavaScript
176
star
35

datasets

Interesting datasets you could use with Algolia
173
star
36

youtube-captions-scraper

Fetch youtube user submitted or fallback to auto-generated captions
JavaScript
173
star
37

algoliasearch-django

Seamless integration of Algolia into your Django project.
Python
167
star
38

algoliasearch-client-ruby

โšก๏ธ A fully-featured and blazing-fast Ruby API client to interact with Algolia.
Ruby
166
star
39

algoliasearch-magento-2

Algolia Search integration for Magento 2 - compatible with versions from 2.3.x to 2.4.x
PHP
156
star
40

instantsearch-android

A library of widgets and helpers to build instant-search applications on Android.
Kotlin
153
star
41

pwa-ecom-ui-template

React/Next.js based starter kit, focused on delivering a rich Search & Discovery e-commerce experience.
TypeScript
145
star
42

instant-search-demo

Instant-search demo (facets, sliders, paginations & more)
CSS
140
star
43

npm-search

๐Ÿ—ฟ npm โ†”๏ธ Algolia replication tool โ›ท๏ธ ๐ŸŒ ๐Ÿ›ฐ๏ธ
TypeScript
127
star
44

algoliasearch-jekyll

โš  DEPRECATED Use jekyll-algolia instead.
Ruby
124
star
45

algoliasearch-client-csharp

โšก๏ธ A fully-featured and blazing-fast C# API client to interact with Algolia.
C#
113
star
46

kubernetes-hands-on

Kubernetes Hands-on by Algolia
110
star
47

firestore-algolia-search

TypeScript
108
star
48

frontman

๐Ÿ’Ž A Ruby-based static website generator
Ruby
107
star
49

create-instantsearch-app

โšก๏ธ Build InstantSearch apps at the speed of thought
JavaScript
107
star
50

algoliasearch-client-android

Algolia Search API Client for Android
Java
98
star
51

faux-jax

NO MORE MAINTAINED: Intercept and respond to requests in the browser (AJAX) and Node.js (http(s) module)
JavaScript
96
star
52

cli

๐Ÿ” Algoliaโ€™s official CLI devtool
Go
94
star
53

algolia-cli-old

[DEPRECATED] This repo and npm package are no longer maintained or supported. The new official command line tool can be found here: https://github.com/algolia/cli
JavaScript
82
star
54

doc-code-samples

This repository holds the Algolia documentation big code samples like GeoSearch, Calendar...
TypeScript
82
star
55

rollup-jest-boilerplate

๐ŸŽ‰ Full featured boilerplate for building JavaScript libraries the modern way
JavaScript
80
star
56

marvel-search

Searchable list of all Marvel superheroes and supervillains
JavaScript
77
star
57

examples

Set of code samples highlighting the different ways to use the Algolia API
CSS
76
star
58

instantsearch-ios-examples

Example apps built with InstantSearch iOS
Swift
67
star
59

instantsearch-android-examples

Example apps built with algolia/instantsearch-android
Kotlin
63
star
60

algoliasearch-client-css

Algolia Search API Client for CSS
JavaScript
63
star
61

mongoolia

Keep your mongoose schemas synced with Algolia
JavaScript
58
star
62

algoliasearch-client-kotlin

โšก๏ธ A fully-featured and blazing-fast Kotlin/Android API client to interact with Algolia.
Kotlin
56
star
63

hn-reactnative-sample

Sample Hacker News Search app by Algolia based on React Native.
JavaScript
54
star
64

jest-serializer-html

Jest snapshot serializer that beautifies HTML.
JavaScript
51
star
65

search-insights.js

Library for reporting click, conversion and view metrics using the Algolia Insights API
TypeScript
51
star
66

redux-updeep

small reducer generator that uses updeep to immutably deep merge partial updates into the reducer's state
JavaScript
50
star
67

algoliasearch-alexa

๐Ÿ”Š Search by voice in Alexa, powered by Algolia
JavaScript
45
star
68

chunk-text

๐Ÿ”ช chunk/split a string by length without cutting/truncating words.
JavaScript
43
star
69

algoliasearch-client-java

โšก๏ธ A fully-featured and blazing-fast Java API client to interact with Algolia.
Java
43
star
70

react-nouislider

CSS
42
star
71

react-test-boilerplate

Companion project for Algolia's React unit testing blog post
JavaScript
41
star
72

demo-geo-search

Demo code illustrating the geo search features of Algolia
JavaScript
39
star
73

laravel-scout-algolia-macros

DEPRECATED: Use of this repository is deprecated. Please use Scout Extended - https://github.com/algolia/scout-extended instead.
PHP
39
star
74

algoliasearch-client-objc

Algolia Search API Client for iOS & OS X
Objective-C
38
star
75

algoliasearch-crawler-github-actions

Algolia Crawler Github action
TypeScript
38
star
76

docsearch-website

Previous repository for the DocSearch documentation website, now at https://github.com/algolia/docsearch/tree/next/packages/website
CSS
38
star
77

algoliasearch-client-node

DEPRECATED
36
star
78

wordpress-docker

Simple docker based environment for WordPress plugins and themes development.
Shell
36
star
79

algoliasearch-rails-example

AlgoliaSearch+Ruby on Rails examples
Ruby
36
star
80

elasticsearch-topk-plugin

Elasticsearch Top-K Aggregation Plugin
Java
35
star
81

algolia-sitemap

a node library allowing you to generate sitemaps from an Algolia index.
JavaScript
33
star
82

jekyll-algolia-example

Front-end example of the jekyll-algolia plugin
HTML
33
star
83

vue-instantsearch-examples

Examples for Vue InstantSearch v1, v2 links: https://github.com/algolia/vue-instantsearch-examples/issues/50
Shell
33
star
84

unified-instantsearch-ecommerce

The fastest way to implement Algolia, for e-commerce customers.
JavaScript
32
star
85

talksearch-scraper

Extract captions and metadata from YouTube playlists and push them to Algolia
JavaScript
31
star
86

diffable-html

Opinionated HTML formatter focused towards making HTML diffs readable.
JavaScript
30
star
87

algoliasearch-client-java-legacy

*DEPRECATED* Algolia Search API Client for Java, see https://github.com/algolia/algoliasearch-client-java-2
Java
30
star
88

api-clients-automation

๐Ÿค– Auto-generated Algolia API clients, specs and tests with โค๏ธ
PHP
30
star
89

recommend

A UI library for Algolia Recommend, available for Vanilla JavaScript and React.
TypeScript
28
star
90

eslint-config-algolia

Algolia's ESLint config and prettier instructions for JavaScript projects
JavaScript
27
star
91

talksearch

๐ŸŽค An interactive search experience for video titles and transcripts
JavaScript
25
star
92

algolia-firebase-nodejs

An example showing how to push data from Firebase to Algolia
JavaScript
24
star
93

algoliasearch-client-scala

โšก๏ธ A fully-featured and blazing-fast Scala API client to interact with Algolia.
Scala
24
star
94

redux-magic-async-middleware

redux-magic-async-middleware is a middleware which makes it easy to handle asynchronous data with redux
JavaScript
23
star
95

laravel-scout-settings

DEPRECATED: Use of this repository is deprecated. Please use Scout Extended - https://github.com/algolia/scout-extended instead.
PHP
23
star
96

pdrone

Control Parrot drones with JavaScript
JavaScript
23
star
97

algolia-swift-demo

iOS instant search tutorial
Swift
23
star
98

algolia-react-boilerplate

๐Ÿ”ฅ A highly scalable, and customizable boilerplate, made with ReactInstantSearchHooks and with many Algolia's features. Ready to configure and deploy. You have just to follow steps in readme file. ๐Ÿ’ฅ
JavaScript
23
star
99

algolia-coding-contest

Welcome to the first Algolia Coding Contest, until May 5th.
22
star
100

algoliasearch-django-example

Python
22
star