esclient

Slim Elasticsearch client for scala

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

de.knutwalker
ArtifactId

ArtifactId

esclient_2.10
Last Version

Last Version

1.7.3
Release Date

Release Date

Type

Type

jar
Description

Description

esclient
Slim Elasticsearch client for scala
Project Organization

Project Organization

knutwalker
Source Code Management

Source Code Management

https://github.com/knutwalker/esclient

Download esclient_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/de.knutwalker/esclient_2.10/ -->
<dependency>
    <groupId>de.knutwalker</groupId>
    <artifactId>esclient_2.10</artifactId>
    <version>1.7.3</version>
</dependency>
// https://jarcasting.com/artifacts/de.knutwalker/esclient_2.10/
implementation 'de.knutwalker:esclient_2.10:1.7.3'
// https://jarcasting.com/artifacts/de.knutwalker/esclient_2.10/
implementation ("de.knutwalker:esclient_2.10:1.7.3")
'de.knutwalker:esclient_2.10:jar:1.7.3'
<dependency org="de.knutwalker" name="esclient_2.10" rev="1.7.3">
  <artifact name="esclient_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.knutwalker', module='esclient_2.10', version='1.7.3')
)
libraryDependencies += "de.knutwalker" % "esclient_2.10" % "1.7.3"
[de.knutwalker/esclient_2.10 "1.7.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.5
org.elasticsearch : elasticsearch jar 1.7.3

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 2.2.4
org.scalacheck : scalacheck_2.10 jar 1.12.2

Project Modules

There are no modules declared in this project.

Elastic Search Client for Scala

The Scala client is a thin wrapper around the Java client. It features:

  • Asynchronous interface
  • Based on Scala 2.10 Futures
  • Single dispatch method (execute)
  • Type-safe Request / Response pairs using 'magnet' pattern

The signature of the execute method (slightly simplified):

implicit class ESClient(client : Client) extends AnyVal {
  def execute[Request, Response](request: Request): Future[Response]
}

Usage

Maven

libraryDependencies += "de.knutwalker" %% "esclient" % "1.7.3"

Note that the esclient versioning is aligned with the elastic search version. This is release based on Elasticsearch version 1.7.3

Sample

import scala.concurrent.{Await, Future}
import scala.concurrent.duration.Duration

import org.elasticsearch.action.index.IndexRequest
import org.elasticsearch.action.index.IndexResponse
import org.elasticsearch.node.NodeBuilder.nodeBuilder
import de.knutwalker.esclient.ESClient

object TestES extends App {

  val client = nodeBuilder.node.client

  val response : Future[IndexResponse] =
    client.execute(new IndexRequest)

  println("Document id: " + Await.result(response, Duration.Inf).id)
}

License

This software is released under the Apache License, Version 2.0

http://www.apache.org/licenses/LICENSE-2.0.html

Versions

Version
1.7.3
1.5.2
1.5.1
1.5.0-1
1.5.0
0.1.1