# Kirby 3 + Algolia

**URL:** <https://forum.getkirby.com/t/kirby-3-algolia/13957>\
**Category:** Questions\
**Tags:** v3\
**Created:** [April 26, 2019, 2:46pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957 "2019-04-26T14:46:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nigel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nigel/32/11287_2.png) [@nigel](https://forum.getkirby.com/u/nigel)\
**Post date:** [April 26, 2019, 2:46pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/1 "2019-04-26T14:46:37Z")

</div>

I have several projects that rely on the Kirby 2 Algolia plugin. My understanding is that there’s no Kirby 3-compatible plugin for Algolia. Does anyone know if an updated plugin is in the works, or a recommendation for an alternative way to accomplish integration?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 26, 2019, 2:56pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/2 "2019-04-26T14:56:22Z")

</div>

There’s not standalone plugin, but you can basically use the files used on the [getirby.com](http://getirby.com) website.

Repo: [https://github.com/getkirby/getkirby.com](https://github.com/getkirby/getkirby.com)  
Relevant files: [Searching with grouped words and operators](https://forum.getkirby.com/t/searching-with-grouped-words-and-operators/13728/6)

---

<div class="post-metadata">

**Author:** ![herrajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/herrajon/32/10985_2.png) [@herrajon](https://forum.getkirby.com/u/herrajon)\
**Post date:** [May 25, 2020, 4:52pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/3 "2020-05-25T16:52:34Z")

</div>

FYI

The search on/in [getkirby.com](http://getkirby.com) site is based on Awesomplete and vanilla search.

The plugin in the Git-Repo for Algola does not update content like it should.

Is there a solid Algolia solution in the pipes for Kirby?

---

<div class="post-metadata">

**Author:** ![nigel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nigel/32/11287_2.png) [@nigel](https://forum.getkirby.com/u/nigel)\
**Post date:** [May 25, 2020, 5:10pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/4 "2020-05-25T17:10:00Z")

</div>

Yes, the Algolia plugin in the [getkirby.com](http://getkirby.com) GitHub repo is very rudimentary. I adapted it and made it more closely mirror the Kirby 2 Algolia plugin by adding a route (for manual reindexing) and hooks to automatically update the index when content changes. It’s been a while since I set up the plugin but I’ve used it on multiple Kirby 3 sites since without issue. Essentially, this is what I added to `index.php` in the plugin.

```
Kirby::plugin('kirby/algolia', [
  'routes' => [
    [
        'pattern' => 'algolia/index',
        'action' => function () {
          algolia()->index();
          echo 'Index updated';
        }
    ],
  ],
  'hooks' => [
    'page.create:after' => function ($page) {
      return algolia()->insertPage($page);
    },
    'page.update:after' => function ($newPage) {
      return algolia()->updatePage($newPage);
    },
    'page.delete:before' => function ($page) {
      return algolia()->deletePageRecursive($page);
    },
    'page.changeNum' => function ($page) {
      return algolia()->updatePage($page);
    },
    'page.changeStatus:before' => function ($page) {
      return algolia()->updatePage($page);
    },
    'page.changeSlug:after' => function ($newPage, $oldPage) {
       return algolia()->movePage($oldPage, $newPage);
    }
  ],
]);
```

---

<div class="post-metadata">

**Author:** ![herrajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/herrajon/32/10985_2.png) [@herrajon](https://forum.getkirby.com/u/herrajon)\
**Post date:** [May 25, 2020, 5:20pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/5 "2020-05-25T17:20:19Z")

</div>

Thank you for sharing @nigel. I appreciate it.

Was looking at the v2 plugin myself. Looking forward to try this out.

Added: Works like a charm.

---

<div class="post-metadata">

**Author:** ![jpangborn](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jpangborn/32/47_2.png) [@jpangborn](https://forum.getkirby.com/u/jpangborn)\
**Post date:** [July 15, 2023, 7:59pm UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/6 "2023-07-15T19:59:43Z")

</div>

Has anyone done further work on Algolia search with Kirby 3? The code @nigel posted above is not working for me. It looks like recent changes to the Search plugin on [getkirby.com](http://getkirby.com) are incompatible with this code. Just wondering if anyone else has made the updates before I go digging through the plugin to fix it.

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [July 17, 2023, 8:19am UTC](https://forum.getkirby.com/t/kirby-3-algolia/13957/7 "2023-07-17T08:19:40Z")

</div>

slightly different approach but still algolia [GitHub - johannschopplich/kirby-algolia-docsearch: 🔦 Index and search your Kirby site with Algolia DocSearch](https://github.com/johannschopplich/kirby-algolia-docsearch)
