com.sksamuel.elastic4s

Type members

Classlikes

case class Adjustment(value: Int, unit: TimeUnit)
trait AggReader[T]
case object Days extends TimeUnit

Implementations of this trait are used to represent dates and date math in elasticsearch requests.

Implementations of this trait are used to represent dates and date math in elasticsearch requests.

see https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math

There are three types of elastic date you can create.

The first is just a wrapped string with no extra help: UnparsedElasticDate("mydate||/d")

The second is a wrapped timestamp: TimestampElasticDate(1113232321L)

The third and most useful is the ElasticDateMath which allows you to programatically add or subtract values, as well as add a rounding, and it will create the appropriate date string for you. For example, ElasticDate.now.minus(3, Months).add(1, Days).rounding(Weeks)

Companion:
object
Companion:
class
case class ElasticDateMath(base: String, adjustments: Seq[Adjustment], rounding: Option[TimeUnit]) extends ElasticDate
case class ElasticError(`type`: String, reason: String, indexUuid: Option[String], index: Option[String], shard: Option[String], rootCause: Seq[ElasticError], causedBy: Option[CausedBy], phase: Option[String], grouped: Option[Boolean], failedShards: Seq[FailedShard])
Companion:
object
Companion:
class
case class FailedShard(shard: Int, index: Option[String], node: Option[String], reason: Option[ElasticError])

Converts between scala types and types that Elasticsearch understands.

Converts between scala types and types that Elasticsearch understands.

trait Hit

A common trait for Get, MultiGet, Search and MultiSearch results to provide common functionality for the HitReader typeclass.

A common trait for Get, MultiGet, Search and MultiSearch results to provide common functionality for the HitReader typeclass.

trait HitReader[T]
case object Hours extends TimeUnit
case class Index(name: String) extends IndexLike
Companion:
object
object Index
Companion:
class
trait IndexLike extends IndexesLike
Companion:
object
object IndexLike
Companion:
class
trait Indexable[T]

A typeclass that is used by index/update requests to convert a scala type into a document that elasticsearch can use.

A typeclass that is used by index/update requests to convert a scala type into a document that elasticsearch can use.

Indexables can be automatically derived if you add a deriving module like elastic4s-json-jackson or elastic4s-json-circe.

case class Indexes(values: Seq[String]) extends IndexesLike

Models one or more indexes, eg

Models one or more indexes, eg

  • "index1"
  • "index1,index2"
  • "_all"
Companion:
object
object Indexes
Companion:
class
Companion:
class
Companion:
object
Companion:
class
case object Minutes extends TimeUnit
case object Months extends TimeUnit

A typeclass that is used to serialize the parameters sent to a com.sksamuel.elastic4s.requests.script.Script.

A typeclass that is used to serialize the parameters sent to a com.sksamuel.elastic4s.requests.script.Script.

ParamSerializers can be automatically derived if you add a module like elastic4s-json-spray.

case object Seconds extends TimeUnit
trait Show[T] extends Serializable
Companion:
object
object Show
Companion:
class
abstract class TimeUnit(val symbol: String)
case class TimestampElasticDate(timestamp: Long) extends ElasticDate
case class UnparsedElasticDate(value: String) extends ElasticDate
case object Weeks extends TimeUnit
case object Years extends TimeUnit

Deprecated classlikes

case class IndexAndType(index: String, `type`: String) extends IndexLike

Models exactly one index associated with exactly one type.

Models exactly one index associated with exactly one type.

Companion:
object
Deprecated
Companion:
class
Deprecated
case class IndexAndTypes(index: String, types: Seq[String]) extends IndexLike

Models one index associated with one or more types.

Models one index associated with one or more types.

So for example,

  • index1/type1
  • index1/type1,type2
Companion:
object
Deprecated
Companion:
class
Deprecated
case class IndexesAndType(indexes: Seq[String], `type`: Option[String])
Companion:
object
Deprecated
case class IndexesAndTypes(indexes: Seq[String], types: Seq[String]) extends IndexesLike

Models one or more indexes associated with zero or more types.

Models one or more indexes associated with zero or more types.

So for example,

  • index1
  • index1/index2
  • index1/type1
  • index1/type1,type2
  • index1,index2/type1
  • index1,index2/type1,type2
Companion:
object
Deprecated
Companion:
class
Deprecated