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

com.sksamuel.elastic4s.requests.validate.ValidateRequest.scala Maven / Gradle / Ivy

There is a newer version: 8.15.1
Show newest version
package com.sksamuel.elastic4s.requests.validate

import com.sksamuel.elastic4s.Indexes
import com.sksamuel.elastic4s.requests.searches.queries.Query
import com.sksamuel.elastic4s.ext.OptionImplicits._

case class ValidateRequest(indexes: Indexes,
                           query: Query,
                           rewrite: Option[Boolean] = None,
                           lenient: Option[Boolean] = None,
                           analyzeWildcard: Option[Boolean] = None,
                           ignoreUnavailable: Option[Boolean] = None,
                           explain: Option[Boolean] = None) {
  require(indexes != null, "value must not be null or empty")

  def rewrite(rewrite: Boolean): ValidateRequest = copy(rewrite = rewrite.some)
  def explain(explain: Boolean): ValidateRequest = copy(explain = explain.some)
  def lenient(lenient: Boolean): ValidateRequest = copy(lenient = lenient.some)
  def ignoreUnavailable(ignore: Boolean): ValidateRequest = copy(ignoreUnavailable = ignore.some)
  def analyzeWildcard(analyze: Boolean): ValidateRequest = copy(analyzeWildcard = analyze.some)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy