diff --git a/modules/search/src/main/Env.scala b/modules/search/src/main/Env.scala index defd4d21be15..35dcf3c69378 100644 --- a/modules/search/src/main/Env.scala +++ b/modules/search/src/main/Env.scala @@ -8,11 +8,7 @@ import lila.common.autoconfig.* import lila.search.client.SearchClient @Module -private class SearchConfig( - val enabled: Boolean, - val writeable: Boolean, - val endpoint: String -) +private class SearchConfig(val enabled: Boolean, val endpoint: String) @Module final class Env( @@ -25,4 +21,4 @@ final class Env( val client: SearchClient = val _client = if config.enabled then SearchClient.play(ws, s"${config.endpoint}/api") else SearchClient.noop - LilaSearchClient(_client, config.writeable) + LilaSearchClient(_client) diff --git a/modules/search/src/main/LilaSearchClient.scala b/modules/search/src/main/LilaSearchClient.scala index e7935a06c6e9..78102de12dae 100644 --- a/modules/search/src/main/LilaSearchClient.scala +++ b/modules/search/src/main/LilaSearchClient.scala @@ -3,36 +3,7 @@ package lila.search import lila.search.client.{ SearchClient, SearchError } import lila.search.spec.* -class LilaSearchClient(client: SearchClient, writeable: Boolean)(using Executor) extends SearchClient: - - override def storeBulkTeam(sources: List[TeamSourceWithId]): Future[Unit] = - client.storeBulkTeam(sources) - - override def storeBulkStudy(sources: List[StudySourceWithId]): Future[Unit] = - client.storeBulkStudy(sources) - - override def storeBulkGame(sources: List[GameSourceWithId]): Future[Unit] = - client.storeBulkGame(sources) - - override def storeBulkForum(sources: List[ForumSourceWithId]): Future[Unit] = - client.storeBulkForum(sources) - - override def store(id: String, source: Source): Future[Unit] = - writeable.so: - monitor("store", source.index): - client.store(id, source) - - override def refresh(index: Index): Future[Unit] = - client.refresh(index) - - override def mapping(index: Index): Future[Unit] = - client.mapping(index) - - override def deleteById(index: Index, id: String): Future[Unit] = - writeable.so(client.deleteById(index, id)) - - override def deleteByIds(index: Index, ids: List[Id]): Future[Unit] = - writeable.so(client.deleteByIds(index, ids)) +class LilaSearchClient(client: SearchClient)(using Executor) extends SearchClient: override def count(query: Query): Future[CountOutput] = monitor("count", query.index): @@ -61,10 +32,3 @@ class LilaSearchClient(client: SearchClient, writeable: Boolean)(using Executor) case q: Query.Game => "game" case q: Query.Study => "study" case q: Query.Team => "team" - - extension (source: Source) - def index = source match - case s: Source.ForumCase => "forum" - case s: Source.GameCase => "game" - case s: Source.StudyCase => "study" - case s: Source.TeamCase => "team" diff --git a/project/Dependencies.scala b/project/Dependencies.scala index b642a3fde878..67d00b8e3921 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -26,7 +26,7 @@ object Dependencies { val lettuce = "io.lettuce" % "lettuce-core" % "6.5.0.RELEASE" val nettyTransport = ("io.netty" % s"netty-transport-native-$notifier" % "4.1.114.Final").classifier(s"$os-$arch") - val lilaSearch = "org.lichess.search" %% "client" % "3.0.2" + val lilaSearch = "org.lichess.search" %% "client" % "3.1.0" val munit = "org.scalameta" %% "munit" % "1.0.2" % Test val uaparser = "org.uaparser" %% "uap-scala" % "0.18.0" val apacheText = "org.apache.commons" % "commons-text" % "1.12.0"