Commit 3711a05d authored by 赵威's avatar 赵威

update type

parent e1c201cc
...@@ -42,12 +42,12 @@ object ESClient { ...@@ -42,12 +42,12 @@ object ESClient {
} }
object ES { object ES {
case class Character(id: String, index: String, projects: Array[String]) case class Character(id: String, index: String, projects: String)
implicit object CharacterHitReader extends HitReader[Character] { implicit object CharacterHitReader extends HitReader[Character] {
override def read(hit: Hit): Try[Character] = { override def read(hit: Hit): Try[Character] = {
val source = hit.sourceAsMap val source = hit.sourceAsMap
Try(Character(source("id").toString, hit.index, source("tags_v3").asInstanceOf[Array[String]])) Try(Character(source("id").toString, hit.index, source("tags_v3").toString))
} }
} }
...@@ -72,7 +72,7 @@ object ES { ...@@ -72,7 +72,7 @@ object ES {
println("%%%%%%%%%%%") println("%%%%%%%%%%%")
println(a.size) println(a.size)
a.foreach { x => a.foreach { x =>
println(x.id, x.index, x.projects.mkString(" ")) println(x.id, x.index, x.projects)
} }
println("%%%%%%%%%%%") println("%%%%%%%%%%%")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment