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

com.sksamuel.elastic4s.searches.queries.ScriptQueryBuilderFn.scala Maven / Gradle / Ivy

The newest version!
package com.sksamuel.elastic4s.searches.queries

import com.sksamuel.elastic4s.ScriptBuilder
import org.elasticsearch.index.query.{QueryBuilders, ScriptQueryBuilder}

object ScriptQueryBuilderFn {
  def apply(q: ScriptQueryDefinition): ScriptQueryBuilder = {
    val builder = QueryBuilders.scriptQuery(ScriptBuilder(q.script))
    q.boost.map(_.toFloat).foreach(builder.boost)
    q.queryName.foreach(builder.queryName)
    builder
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy