Skip to content

Latest commit

 

History

History
executable file
·
59 lines (39 loc) · 1.59 KB

README.textile

File metadata and controls

executable file
·
59 lines (39 loc) · 1.59 KB

ElasticSearch BulkTag Plugin

Perform Bulk Partial updates to indexed documents

This plugin will bulk-update every document in the index with the data it recieves.

How do you build this plugin?

Start by specifying the elasticsearch version in the pom.xml.

...
<elasticsearch.version>0.17.7</elasticsearch.version>
...

Use maven to build the package

mvn package

Then install the plugin

# if you've built it locally
$ES_HOME/bin/plugin -url ./target -install bulktag

# if you just want to install the pre-built package from github
$ES_HOME/bin/plugin install egaumer/bulktag

How to use this plugin.

Start by indexing some sample doucuments

curl -XPOST http://localhost:9200/index/type1/1/ -d'{"name":"doc1"}'
curl -XPOST http://localhost:9200/index/type1/2/ -d'{"name":"doc2"}'
curl -XPOST http://localhost:9200/index/type1/3/ -d'{"name":"doc3"}'

Use a search and verify things were indexed

curl 'http://localhost:9200/index/type1/_search?q=*&pretty=true'

To add a set of tags to each of these documents, POST to the new endpoint.

curl -XPOST http://localhost:9200/_bulktag -d '{"tags":["red","blue","green"]}'

Perform another search and verify the documents were all updated.

Note
This HTTP call is asynchornous meaning the call will start the update and immediately return. If you are updating a large number of documents, it could take several minutes (or longer) to actually complete. Yoi can watch the logs to track progress and look for failures.