How to build Elasticsearch Vietnamese Analysis Plugin

Recently, I’ve received many requests to build the Vietnamese Analysis plugin when a new version of Elasticsearch is released but sometimes I’m not available to do it immediately. In case of urgent, you can build the plugin yourself with following steps.

Step 1: Install Java, Maven & Git

The plugin is written in Java and built with Maven, so you have to install them first. Here is the instructions for installing Java, Maven and Git.

If you are using Mac, just use these commands:

brew cask install java
brew install maven
brew install git

Step 2: Build the VnTokenizer

The plugin is based on the VNTokenizer library, you have to build it before building the plugin

git clone https://github.com/duydo/vn-nlp-libraries.git
cd vn-nlp-libraries/nlp-parent
mvn install

Step 3: Build the plugin

Clone the plugin’s source code:

git clone https://github.com/duydo/elasticsearch-analysis-vietnamese.git

Edit the elasticsearch-analysis-vietnamese/pom.xml to change the version of Elasticsearch you want to build the plugin with:

<properties>
  ...
    <project.build.java.version>1.8</project.build.java.version>
    <elasticsearch.version>5.2.1</elasticsearch.version>
    <lucene.version>6.4.1</lucene.version>
    ...
</properties>

Build the plugin:

cd elasticsearch-analysis-vietnamese
mvn package -DskipTests

Step 4: Install the plugin

bin/elasticsearch-plugin install file:target/releases/elasticsearch-analysis-vietnamese-5.2.1.zip

Duy Do

Father. Husband. Software Engineer

Ho Chi Minh city, Vietnam http://duydo.me