PHPackages                             trendyminds/algolia - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. trendyminds/algolia

ActiveCraft-plugin[Search &amp; Filtering](/categories/search)

trendyminds/algolia
===================

Easily pull search results from Algolia into your Craft CMS website

5.0.1(1y ago)1232.3k[2 PRs](https://github.com/trendyminds/algolia/pulls)MITPHPPHP ^8.2

Since Nov 14Pushed 1y ago3 watchersCompare

[ Source](https://github.com/trendyminds/algolia)[ Packagist](https://packagist.org/packages/trendyminds/algolia)[ RSS](/packages/trendyminds-algolia/feed)WikiDiscussions craft-4 Synced today

READMEChangelog (8)Dependencies (3)Versions (14)Used By (0)

[![Algolia logo](src/icon.svg)](src/icon.svg) Algolia
=====================================================

[](#-algolia)

[![Query your Algolia data using Twig](resources/promo-banner.png)](resources/promo-banner.png)

About
-----

[](#about)

Algolia for Craft CMS allows you to easily pull search results from Algolia into your Twig templates or through REST API endpoints.

Template Usage
--------------

[](#template-usage)

### Browse an index

[](#browse-an-index)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in the `params` object.

```
{% for result in craft.algolia.browse({
    index: "indexName",
    query: "optional query",
    params: {
      distinct: true,
      getRankingInfo: true
    }
  })
%}

{% endfor %}
```

### Search an index

[](#search-an-index)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in the `params` object.

```
{% set search = craft.algolia.search({
    index: "indexName",
    query: "optional query",
    params: {
      hitsPerPage: 5,
      page: 7
    }
  })
%}

{% for hit in search.hits %}

{% endfor %}
```

### Perform a multiple query search

[](#perform-a-multiple-query-search)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in each `queries` object.

```
{% set search = craft.algolia.multipleQueries([
    {
      indexName: "indexName1",
      query: "optional query"
    },
    {
      indexName: "indexName2",
      query: "optional query"
    }
  ])
%}

{% for group in search.results %}
  {% for hit in group.hits %}

  {% endfor %}
{% endfor %}
```

### Parsing filters

[](#parsing-filters)

When using filters in an Algolia search the engine requires [a particular syntax](https://www.algolia.com/doc/api-reference/api-parameters/filters/). Rather than stringifying your filters in Twig this plugin offers a way to convert an object like...

```
{
  "food": ["fries", "cake", "pizza"],
  "colors": ["blue", "green", "red"],
  "featured": true
}
```

to a valid Algolia filter string like...

```
'(food:"fries" OR food:"cake" OR food:"pizza") AND (colors:"blue" OR colors:"green" OR colors:"red") AND (featured:"1")'

```

```
{% set filters = {
  food: ['fries', 'cake', 'pizza'],
  colors: ['blue', 'green', 'red'],
  featured: true
} %}

{{ craft.algolia.parseFilters(filters) }}
```

Using JSON REST API controllers
-------------------------------

[](#using-json-rest-api-controllers)

In additional to Twig variables you can make a `POST` request to one of the following controller endpoints. The same index, query and optional attributes are available when you make your `POST` request.

**NOTE**: The following examples use [Axios](https://github.com/axios/axios) for making API requests

### Browse an index

[](#browse-an-index-1)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in the `params` object.

```
axios.post("/actions/algolia/default/browse", {
  index: "indexName",
  query: "optional query",
  params: {
    distinct: true,
    getRankingInfo: true
  }
}, {
  headers: {
    "X-CSRF-Token": YOUR_CRAFT_CSRF_TOKEN
  }
});
```

### Search an index

[](#search-an-index-1)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in the `params` object.

```
axios.post("/actions/algolia/default/search", {
  index: "indexName",
  query: "optional query",
  params: {
    hitsPerPage: 5,
    page: 7
  }
}, {
  headers: {
    "X-CSRF-Token": YOUR_CRAFT_CSRF_TOKEN
  }
});
```

### Perform a multiple query search

[](#perform-a-multiple-query-search-1)

[Additional search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) can be provided in each `queries` object.

```
axios.post("/actions/algolia/default/multiple-queries", {
  queries: [
    {
      indexName: "indexName1",
      query: "optional query"
    },
    {
      indexName: "indexName2",
      query: "optional query"
    }
  ]
}, {
  headers: {
    "X-CSRF-Token": YOUR_CRAFT_CSRF_TOKEN
  }
});
```

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.1.19+ and PHP 7.1+.

Installation
------------

[](#installation)

[Install Algolia from the Craft CMS Plugin Store!](https://plugins.craftcms.com/algolia)

Attribution
-----------

[](#attribution)

This plugin is powered by the [Algolia PHP API client](https://www.algolia.com/doc/api-client/getting-started/install/php/). The client and icon/logo belong to Algolia.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~321 days

Recently: every ~296 days

Total

8

Last Release

419d ago

Major Versions

2.0.0 → 3.0.02021-06-29

3.1.0 → 4.0.02022-07-05

4.0.0 → 5.0.02024-04-05

4.0.1 → 5.0.12025-05-12

PHP version history (4 changes)3.0.0PHP &gt;=7.1

3.1.0PHP &gt;=7.3

4.0.0PHP ^8.0.2

5.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/51ee860b8a11c81c32b2d0bf9f90e23067fcf3cf72476bfab89913bf0e1ea3b3?d=identicon)[trendyminds](/maintainers/trendyminds)

---

Top Contributors

[![aaronbushnell](https://avatars.githubusercontent.com/u/315202?v=4)](https://github.com/aaronbushnell "aaronbushnell (26 commits)")

---

Tags

algoliacmsCraftcraftcmscraft-plugin

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/trendyminds-algolia/health.svg)

```
[![Health](https://phpackages.com/badges/trendyminds-algolia/health.svg)](https://phpackages.com/packages/trendyminds-algolia)
```

###  Alternatives

[studioespresso/craft-scout

Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.

80143.5k](/packages/studioespresso-craft-scout)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)[swixpop/locate

Harness the power of the Google Autocomplete API inside Craft. Adds an autocomplete search box to Craft entries.

154.8k](/packages/swixpop-locate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
