sort searched studies by relevance then by popularity

proxy-selector
Thibault Duplessis 2016-07-26 03:29:29 +02:00
parent a5bd79f2a4
commit 0059361484
3 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ final class Env(
private val client = makeClient(Index(IndexName))
private val indexThrottler = system.actorOf(Props(new MultiThrottler(
executionTimeout = 2.seconds.some,
executionTimeout = 3.seconds.some,
logger = logger)
))

View File

@ -9,7 +9,7 @@ private[studySearch] object Fields {
// val createdAt = "createdAt"
// val updatedAt = "updatedAt"
// val rank = "rank"
// val likes = "likes"
val likes = "likes"
val public = "public"
object chapter {

View File

@ -27,7 +27,7 @@ final class StudySearchApi(
indexThrottler ! MultiThrottler.work(
id = study.id,
run = studyRepo byId study.id flatMap { _ ?? doStore },
delay = 5.seconds.some)
delay = 30.seconds.some)
}
private def doStore(study: Study) =
@ -45,7 +45,7 @@ final class StudySearchApi(
Fields.chapterTexts -> noMultiSpace(s.chapters.map(chapterText).mkString(" ")),
// Fields.createdAt -> study.createdAt)
// Fields.updatedAt -> study.updatedAt,
// Fields.rank -> study.rank,
Fields.likes -> s.study.likes.value,
Fields.public -> s.study.isPublic)
private def chapterText(c: Chapter): String = nodeText(c.root)