Commit 7ab85667 authored by 赵威's avatar 赵威

save info

parent ddfba5cc
......@@ -59,16 +59,16 @@ object Main {
println(deviceId)
println(projects.mkString(" "))
val diaryReq = ES.generateDiaryRequest(projects, secondDemands, cityId)
val tractateReq = ES.generateTractateRequest(projects, secondDemands)
val answerReq = ES.generateAnswerRequest(projects, secondDemands)
val serviceDiaryReq = ES.generateServiceDiaryRequest(projects, secondDemands, cityId)
val a = ES.request(diaryReq)
val diaryReq = ES.generateDiaryRequest(projects, secondDemands, cityId, 300)
val tractateReq = ES.generateTractateRequest(projects, secondDemands, 300)
val answerReq = ES.generateAnswerRequest(projects, secondDemands, 100)
val serviceDiaryReq = ES.generateServiceDiaryRequest(projects, secondDemands, cityId, 100)
Redis.save(ES.request(diaryReq), deviceId, "diary")
// ES.test(diaryReq, tractateReq, answerReq, serviceDiaryReq)
Redis.save(ES.request(tractateReq), deviceId, "tractate")
Redis.save(ES.request(answerReq), deviceId, "answer")
Redis.save(ES.request(serviceDiaryReq), deviceId, "service_diary")
println("########################")
deviceId
}
......
......@@ -107,9 +107,9 @@ object ES {
def generateDiaryRequest(
projects: List[String],
secondDemands: List[String],
cityId: Int = -1
cityId: Int = -1,
size: Int = 300
): SearchRequest = {
val size = 15
val includes = List("id", "tags_v3")
var scoreListBuffer: ListBuffer[ScoreFunction] = ListBuffer.empty[ScoreFunction]
var shouldListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
......@@ -167,8 +167,11 @@ object ES {
res
}
def generateTractateRequest(projects: List[String], secondDemands: List[String]): SearchRequest = {
val size = 15
def generateTractateRequest(
projects: List[String],
secondDemands: List[String],
size: Int = 300
): SearchRequest = {
val includes = List("id", "tags_v3")
var scoreListBuffer: ListBuffer[ScoreFunction] = ListBuffer.empty[ScoreFunction]
var shouldListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
......@@ -212,8 +215,11 @@ object ES {
res
}
def generateAnswerRequest(projects: List[String], secondDemands: List[String]): SearchRequest = {
val size = 15
def generateAnswerRequest(
projects: List[String],
secondDemands: List[String],
size: Int = 100
): SearchRequest = {
val includes = List("id", "tags_v3")
var scoreListBuffer: ListBuffer[ScoreFunction] = ListBuffer.empty[ScoreFunction]
var shouldListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
......@@ -264,9 +270,9 @@ object ES {
def generateServiceDiaryRequest(
projects: List[String],
secondDemands: List[String],
cityId: Int = -1
cityId: Int = -1,
size: Int = 100
): SearchRequest = {
val size = 15
val includes = List("id", "tags_v3")
var shouldListBuffer: ListBuffer[Query] = ListBuffer.empty[Query]
......
......@@ -18,7 +18,7 @@ object Redis {
if (ids.size > 0) {
pRc4.del(key)
ids.foreach { id =>
println(id)
// println(id)
pRc4.rpush(key, id)
}
pRc4.expire(key, 60 * 60 * 24 * 15)
......
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