All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sksamuel.elastic4s.DeleteIndexDsl.scala Maven / Gradle / Ivy

There is a newer version: 6.0.0-rc1
Show newest version
package com.sksamuel.elastic4s

import org.elasticsearch.action.admin.indices.delete.{DeleteIndexRequest, DeleteIndexResponse}
import org.elasticsearch.client.Client

import scala.concurrent.Future

/** @author Stephen Samuel */
trait DeleteIndexDsl {

  implicit object DeleteIndexDefinitionExecutable
    extends Executable[DeleteIndexDefinition, DeleteIndexResponse, DeleteIndexResponse] {
    override def apply(c: Client, t: DeleteIndexDefinition): Future[DeleteIndexResponse] = {
      injectFuture(c.admin.indices.delete(t.build, _))
    }
  }
}

case class DeleteIndexDefinition(indexes: Seq[String]) {
  private val builder = new DeleteIndexRequest().indices(indexes: _*)
  def build = builder
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy