Coder Social home page Coder Social logo

discourse-elasticsearch's Introduction

discourse-elasticsearch

discourse-elasticsearch is a plugin for elasticsearch forked from discourse-algolia

Installation

Follow Install a Plugin

Installation Add this repository's git clone url to your container's app.yml file, at the bottom of the cmd section:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/hankcs/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/KennFalcon/elasticsearch-analysis-hanlp/releases/download/v7.5.1/elasticsearch-analysis-hanlp-7.5.1.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.

discourse-elasticsearch's People

Contributors

hankcs avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.