(Quick Reference)

7 Low level API - Reference Documentation

Authors: Noam Y. Tenne, Manuarii Stein, Stephane Maldini, Serge P. Nekoval, Marcos Carceles

Version: 0.0.4.6

7 Low level API

If you need to use the Elastic Search client directly, you can use the elasticSearchHelper bean that is injected in any services/controllers to get the current instance. Simply encapsulate your code within a withElasticSearch bloc, and you will get a org.elasticsearch.client.Client implementation to play with.

class MySearchService {
    static transactional = true

def elasticSearchHelper

def myMethod(indexName, settings) { elasticSearchHelper.withElasticSearch { client -> // Do some stuff with the ElasticSearch client client.admin() .indices() .prepareCreate(indexName) .setSettings(settings) .execute() .actionGet() } } }

Please refers to the Elastic Search API for more information on the methods and properties available on the client.