Skip to content

Commit

Permalink
Added support for get templates command
Browse files Browse the repository at this point in the history
Elasticsearch v0.90.4
elastic/elasticsearch@45c0d1d
  • Loading branch information
Fabien Pennequin committed Mar 7, 2014
1 parent d53f84b commit b77126b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/scala/scalastic/elasticsearch/IndexCrud.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ trait IndexCrud
with Alias with Unalias
with PutMapping with DeleteMapping
with PutTemplate with DeleteTemplate
with GetTemplates
with ClearCache
with Flush
with Refresh
Expand Down Expand Up @@ -440,6 +441,16 @@ trait DeleteTemplate {
}
}

trait GetTemplates {
self: Indexer =>
def getTemplates(names: Iterable[String]) = getTemplates_send(names).actionGet
def getTemplates_send(names: Iterable[String]) = getTemplates_prepare(names).execute
def getTemplates_prepare(names: Iterable[String]) = {
val request = client.admin.indices.prepareGetTemplates(names.toArray: _*)
request
}
}

trait Open {
self: Indexer =>
def openIndex(index: String, timeout: Option[String] = None) = openIndex_send(index, timeout).actionGet
Expand Down

0 comments on commit b77126b

Please sign in to comment.