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

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

The newest version!
package com.sksamuel.elastic4s

import com.sksamuel.elastic4s.indexes.IndexDefinition
import com.sksamuel.elastic4s.searches.QueryBuilderFn
import com.sksamuel.elastic4s.searches.queries.QueryDefinition

trait PercolateDsl {
  self: ElasticDsl =>

  def register(query: QueryDefinition) = new RegisterExpectsInto(query)
  class RegisterExpectsInto(query: QueryDefinition) {
    def into(indexType: IndexAndType, field: String = "query"): IndexDefinition = {
      val src = s""" { "$field" : ${QueryBuilderFn(query).toString} } """
      indexInto(indexType).source(src)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy