Graylog2/graylog2-server — pull request #65 by joschi (2011-12-18 16:54:58+00:00)
Title: Use elasticsearch API

graylog2-server currently uses the [elasticsearch API over HTTP](http://www.elasticsearch.org/guide/reference/modules/http.html) to check for and create indices, to index new messages, and to remove old messages.

There is also a native [Java API](http://www.elasticsearch.org/guide/reference/java-api/) which could be used in graylog2-server and which could bring some performance advantages over using the API over HTTP regarding bulk message indexing. But I haven't done any performance and throughput benchmarks yet.

Since the Java API depends on the full elasticsearch JAR this could also be used to implement an embedded ES service so that the user wouldn't have to install an external elasticsearch server and cope with its administration. For smaller installations (or for testing purposes) this would save some setup time.

This changeset basically pulls an interface out of the previous `Indexer` class and refactors the old implementation to an implementation of the interface. It shouldn't change the behaviour of graylog2-server (except for the index creation which moved from the `Main` class to the Indexer implementation).