Commit 0ac13815 authored by 赵威's avatar 赵威

add includes

parent 877856da
......@@ -57,6 +57,7 @@ object ES {
implicit object ContentHitReader extends HitReader[Content] {
override def read(hit: Hit): Try[Content] = {
val source = hit.sourceAsMap
println(source)
val serviceId = source.get("service.id").asInstanceOf[Some[Long]]
Try(
Content(source("id").toString.toLong, hit.index, serviceId, source("tags_v3").toString)
......@@ -68,7 +69,9 @@ object ES {
def request(req: SearchRequest): Either[Throwable, Future[IndexedSeq[Content]]] = {
val client: ElasticClient = ESClient.create("172.16.52.33", 9200, "elastic", "gengmei!@#")
// println(req.show)
println("!!!!!!!!!!!!!!")
println(req.show)
println("!!!!!!!!!!!!!!")
println("@@@@@@@@@@@@@")
client.execute(req).map { resp =>
val a = resp.result.to[Content]
......@@ -358,7 +361,7 @@ object ES {
cityId: Int = -1,
size: Int = 100
): SearchRequest = {
val includes = List("id", "tags_v3")
val includes = List("id", "tags_v3", "service")
var shouldListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
val mustNotListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
mustNotListBuffer += termQuery("show_by_index", 2)
......
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