Hi. I am programming in scala and using elastic4s. I have an index that contains many documents each indexed using a specific unique id. How can I get the value of one of my fields: ClientId from the index using the id? I really want to know if this field exists yet or has something in it.
// Check if we already called the Web Service API for this RunId/JobId, if not, call it
val resp: Future[RichGetResponse] = elasticSearchClient.execute {
get ((jobId, runId)) from "elk-indexing-node/elk-indexing-group"
}
// Whenever this future comes back, check if we already got the DTO data. If not, get it and
// write it to Elasticsearch.
resp.onComplete{
case Success(p) => {
val d = p
log.error(s"Already got JobDTO data and the Client is: ${d.getField("Client")} !!!")
}
I keep getting the string: "Already got JobDTO data and the Client is: null !!!"
I want the data from the field "Client" which is 2
Thank you. It doesn't appear that the version of elastic4s I am using, has the "get" API yet. I tried to go to the latest version in my build.sbt, but it gives me auth errors. No sure why. The version I am currently using in my build.sbt is:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.