Commit edcd86c0 authored by 赵威's avatar 赵威

add index

parent e965f9e5
......@@ -42,12 +42,12 @@ object ESClient {
}
object ES {
case class Character(id: String)
case class Character(id: String, index: String)
implicit object CharacterHitReader extends HitReader[Character] {
override def read(hit: Hit): Try[Character] = {
val source = hit.sourceAsMap
Try(Character(source("id").toString))
Try(Character(source("id").toString, hit.index))
}
}
......@@ -70,7 +70,7 @@ object ES {
val a = resp.result.to[Character]
println("%%%%%%%%%%%")
a.foreach(x => println(x.id))
a.foreach(x => println(x.id, x.index))
println("%%%%%%%%%%%")
resp
......@@ -78,7 +78,7 @@ object ES {
// SearchRequest
def generateDiaryQuery(projects: List[String], secondDemands: List[String], cityId: Int = -1): String = {
val size = 2
val size = 15
val includes = List("id", "tags_v3")
// TODO read
......@@ -183,7 +183,7 @@ object ES {
}
def generateTractateQuery(projects: List[String], secondDemands: List[String]): String = {
val size = 2
val size = 15
val includes = List("id", "tags_v3")
val functions = new ListBuffer[JObject]()
......
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