0

I've upgraded Elastic search from "2.3.4" to "7.10.0".

Added below dependencies under my build.sbt:

 "org.elasticsearch.client" % "elasticsearch-rest-client" % "7.10.0",
 "org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.10.0",
 "org.elasticsearch" % "elasticsearch" % "7.10.0"

Getting compile time issue for TotalHits while fetching it through SearchResponse.getHits().getTotalHits()

Can someone help me out how to resolve this? I thought adding above three dependencies would be enough!

Devkinandan Chauhan
  • 1,785
  • 1
  • 17
  • 42

1 Answers1

0

After some R&D, resolved above issue by adding below dependency:

"org.apache.lucene" % "lucene-core" % "8.9.0"
Devkinandan Chauhan
  • 1,785
  • 1
  • 17
  • 42
  • How lucene-core has solved the issue? And how exactly it is getting used. I am upgrading ES version from 6.5 to 7.10 and ES high level client library of previous version is resulting in hits field value as 0 as the format got changed – Ravi Apr 25 '23 at 15:05