sort searched studies by relevance then by popularity
parent
a5bd79f2a4
commit
0059361484
|
@ -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)
|
||||
))
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue