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

com.sksamuel.elastic4s.handlers.searches.queries.SemanticQueryBuilderFn.scala Maven / Gradle / Ivy

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

import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.queries.SemanticQuery

object SemanticQueryBuilderFn {
  def apply(q: SemanticQuery): XContentBuilder = {
    val builder = XContentFactory.jsonBuilder()
    builder.startObject("semantic")
    builder.field("field", q.field)
    builder.field("query", q.query)
    builder.endObject()
    builder
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy