From 123a41106288b11502fbf95e27d73dfc2ba125e6 Mon Sep 17 00:00:00 2001 From: Jakub Chrobasik Date: Thu, 7 Mar 2024 09:32:45 +0100 Subject: [PATCH] feat: code review comments --- .../main/scala/io/renku/search/api/data/SearchEntity.scala | 4 ++-- .../src/main/scala/io/renku/search/solr/query/SolrToken.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/search-api/src/main/scala/io/renku/search/api/data/SearchEntity.scala b/modules/search-api/src/main/scala/io/renku/search/api/data/SearchEntity.scala index 4cb55d36..a1a2f918 100644 --- a/modules/search-api/src/main/scala/io/renku/search/api/data/SearchEntity.scala +++ b/modules/search-api/src/main/scala/io/renku/search/api/data/SearchEntity.scala @@ -89,8 +89,8 @@ object SearchEntity: FieldName(discriminatorField), Schema.string, List( - implicitly[Schema[Project]].name.map(SRef(_)).map("Project" -> _), - implicitly[Schema[User]].name.map(SRef(_)).map("User" -> _) + summon[Schema[Project]].name.map(SRef(_)).map("Project" -> _), + summon[Schema[User]].name.map(SRef(_)).map("User" -> _) ).flatten.toMap ) ) diff --git a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrToken.scala b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrToken.scala index 4ad2b866..e5d5b5b1 100644 --- a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrToken.scala +++ b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrToken.scala @@ -24,7 +24,7 @@ import cats.syntax.all.* import io.renku.search.model.EntityType import io.renku.search.model.projects.Visibility import io.renku.search.query.{Comparison, Field} -import io.renku.search.solr.documents.{Entity, Project as SolrProject, User as SolrUser} +import io.renku.search.solr.documents.{Project as SolrProject, User as SolrUser} import io.renku.search.solr.schema.EntityDocumentSchema.Fields as SolrField import io.renku.solr.client.schema.FieldName @@ -73,7 +73,7 @@ object SolrToken: def dateLt(field: Field, date: Instant): SolrToken = fieldIs(field, s"[* TO ${fromInstant(date)}]") - val allTypes: SolrToken = Entity.allTypes.map(fieldIs(Field.Type, _)).toList.combineAll + val allTypes: SolrToken = fieldIs(Field.Type, "*") private def fieldOp(field: Field, op: Comparison, value: SolrToken): SolrToken = val cmp = fromComparison(op)