# Algolia plugin indexation

**URL:** https://meta.discourse.org/t/algolia-plugin-indexation/42237
**Category:** Plugin
**Created:** [April 8, 2016, 12:42pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237 "2016-04-08T12:42:04Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![matthieu\_lamarque](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu_lamarque/32/120426_2.png) [@matthieu\_lamarque](https://meta.discourse.org/u/matthieu_lamarque)
#### Post date: [April 8, 2016, 12:42pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/1 "2016-04-08T12:42:04Z")

</div>

Hello,  
this is a little plugin which allow to index data in Algolia Indexes.

[https://github.com/mlamarque/algoliasearch-discourse](https://github.com/mlamarque/algoliasearch-discourse)

This plugin is work in progress to fetch data from front-office.

it’s, of course, open source, so help / feedback is welcome.

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [August 2, 2017, 11:26am UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/2 "2017-08-02T11:26:55Z")

</div>

Hi @matthieu_lamarque,

I’d love to get this working! But I’m having some issues with the Docker install.

If you follow the original instructions, it won’t work, since it’ll be removed after a rebuild. So I guess I need to somehow get this into the app.yml

Simply adding any of the following variations to `app.yml` yields errors and I don’t have the Ruby/Docker knowledge to debug them properly.

```bash
bundle exec rake plugin:install repo=https://github.com/mlamarque/algoliasearch-discourse.git
rake plugin:install repo=https://github.com/mlamarque/algoliasearch-discourse.git
git clone https://github.com/mlamarque/algoliasearch-discourse.git

```

They all yield (a variation of) `NameError: uninitialized constant AlgoliaSearch`

I have a feeling it’s a simple fix, if you or anyone else can, please help 🙂

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [August 2, 2017, 1:19pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/3 "2017-08-02T13:19:03Z")

</div>

> [@Bas](#):
>
> So I guess I need to somehow get this into the app.yml

Yes, that’s it. Here’s how you do that:

> [@Install plugins on a self-hosted site](https://meta.discourse.org/t/install-a-plugin/19157):
>
> warning This guide assumes that you have a self-hosted standard installation. We only support the standard method of install here, so these instructions assume you have a [standard install](https://meta.discourse.org/t/142537?silent=true). warning This guide only applies to self-hosted Discourse instances. If you are using a managed hosting service, the available plugins are controlled by your hosting provider. For example, on our hosting [these specific plugins](https://www.discourse.org/plugins) are available by hosting tier. information_source As of mid-2025, [many p…](https://meta.discourse.org/t/373574)

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [August 2, 2017, 1:44pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/4 "2017-08-02T13:44:19Z")

</div>

Hey Felix, that’s exactly where I’m stuck 🙂

My current `app.yml` contains;

```bash
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/vinkas0/discourse-navigation.git
          - git clone https://github.com/vinkas0/discourse-branding.git
          - git clone https://github.com/discourse/discourse-solved.git

          - git clone https://github.com/mlamarque/algoliasearch-discourse.git

```

The first three load perfectly fine, the last one fails

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [August 2, 2017, 2:53pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/5 "2017-08-02T14:53:10Z")

</div>

YAML is _very_ picky about whitespace. Remove the blank line (which contains a space) and make sure there aren’t any tabs in there, then try again 🙂

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [August 2, 2017, 3:05pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/6 "2017-08-02T15:05:33Z")

</div>

Thanks for the debugging, but that’s not it either unfortunately

this fails:

```bash
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/vinkas0/discourse-navigation.git
          - git clone https://github.com/vinkas0/discourse-branding.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/mlamarque/algoliasearch-discourse.git

```

this works (but of course, doesn’t install the plugin):

```bash
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/vinkas0/discourse-navigation.git
          - git clone https://github.com/vinkas0/discourse-branding.git
          - git clone https://github.com/discourse/discourse-solved.git
# - git clone https://github.com/mlamarque/algoliasearch-discourse.git

```

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [August 2, 2017, 3:31pm UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/7 "2017-08-02T15:31:15Z")

</div>

Can you post the log from the `rebuild` command?

The plugin may be incompatible with current versions of Discourse.

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [August 3, 2017, 11:52am UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/8 "2017-08-03T11:52:18Z")

</div>

Yeah, I’m afraid that it might be outdated ☹

Log is rather long, relevant part:

```bash
(...)
Bundled gems are installed into ./vendor/bundle.

I, [2017-08-03T11:42:56.485801 #14] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
NameError: uninitialized constant AlgoliaSearch
/var/www/discourse/plugins/algoliasearch-discourse/plugin.rb:9:in `block in activate!'
/var/www/discourse/lib/plugin/instance.rb:208:in `block in notify_after_initialize'
(...)

```

Full log: [log.txt.gz](https://global.discourse-cdn.com/meta/original/3X/f/6/f6ceeef624b0023dc3ff3cd5c5d9e313bea3aed9.gz) (41.9 KB)

---

<div class="post-metadata">

### Author: ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)
#### Post date: [September 25, 2017, 9:36am UTC](https://meta.discourse.org/t/algolia-plugin-indexation/42237/9 "2017-09-25T09:36:11Z")

</div>

fyi: one of our Ruby devs made a PR on this which was accepted 🙂

Plugin is no longer #plugin:broken-plugin
