https://github.com/m2nx/discourse-elasticsearch
discourse plugin to support elasticsearch
https://github.com/m2nx/discourse-elasticsearch
Last synced: 8 months ago
JSON representation
discourse plugin to support elasticsearch
- Host: GitHub
- URL: https://github.com/m2nx/discourse-elasticsearch
- Owner: m2nx
- License: mit
- Created: 2019-07-23T07:09:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-26T10:57:43.000Z (about 6 years ago)
- Last Synced: 2025-04-06T17:06:12.640Z (9 months ago)
- Language: JavaScript
- Size: 1.27 MB
- Stars: 11
- Watchers: 0
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discourse-elasticsearch
discourse-elasticsearch is a plugin for elasticsearch forked from [discourse-algolia](https://github.com/discourse/discourse-algolia)
## Installation
Follow [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/19157)
Installation
Add this repository's git clone url to your container's app.yml file, at the bottom of the cmd section:
```yml
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/imMMX/discourse-elasticsearch.git
```
Rebuild your container:
```
cd /var/discourse
git pull
./launcher rebuild app
```
Then you need install a elasticsearch(version 7.2.0) server, here's a docker example:
```
docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk --restart=always -d elk:7.2.0
```
Install elk chinese plugin:
```
docker exec -it elk bash
./bin/elasticsearch-plugin install -b https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.2.0/elasticsearch-analysis-ik-7.2.0.zip
```
## Configuration
Once you've installed the plugin and restarted your Discourse, you will see a new plugin available in your admin configuration. Click the Settings button next to the discourse-elasticsearch plugin.
## Initial indexing
You can now index all of your forum's content. Run the following rake task in your Discourse directory:
```
./launcher enter app
su discourse
LOAD_PLUGINS=1 bundle exec rails elasticsearch:initialize
```
This will create and configure three indices - discourse-users, discourse-posts, and discourse-tags - and then populate them by loading data from your database and sending it to Elasticsearch.
## Rake tasks
```
rake elasticsearch:configure # configure elasticsearch index settings
rake elasticsearch:initialize # configure indices and upload data
rake elasticsearch:reindex # reindex everything to elasticsearch
rake elasticsearch:reindex_posts # reindex posts in elasticsearch
rake elasticsearch:reindex_tags # reindex tags in elasticsearch
rake elasticsearch:reindex_users # reindex users in elasticsearch
```
## Usage
## Feedback
If you have issues or suggestions for the plugin, please open an issue.