1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.operation
21 
22 import cats.implicits._
23 import com.sksamuel.elastic4s.Index
24 import com.sksamuel.elastic4s.ElasticDsl._
25 import com.sksamuel.elastic4s.circe._
26 import com.sksamuel.elastic4s.requests.common.RefreshPolicy
27 import com.sksamuel.elastic4s.requests.searches.SearchRequest
28 import com.sksamuel.elastic4s.requests.searches.sort.{FieldSort, SortOrder}
29 import com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery
30 import grizzled.slf4j.Logging
31 import io.circe.{Json, Printer}
32 import org.make.api.technical.elasticsearch._
33 import org.make.api.views.Highlights
34 import org.make.core.CirceFormatters
35 import org.make.core.elasticsearch.IndexationStatus
36 import org.make.core.operation.indexed.{
37   IndexedOperationOfQuestion,
38   OperationOfQuestionElasticsearchFieldName,
39   OperationOfQuestionSearchResult
40 }
41 import org.make.core.operation.{OperationOfQuestionSearchFilters, OperationOfQuestionSearchQuery}
42 import org.make.core.question.QuestionId
43 
44 import scala.concurrent.ExecutionContext.Implicits.global
45 import scala.concurrent.Future
46 
47 trait OperationOfQuestionSearchEngineComponent {
48   def elasticsearchOperationOfQuestionAPI: OperationOfQuestionSearchEngine
49 }
50 
51 trait OperationOfQuestionSearchEngine {
52   def findOperationOfQuestionById(questionId: QuestionId): Future[Option[IndexedOperationOfQuestion]]
53   def count(query: OperationOfQuestionSearchQuery): Future[Long]
54   def searchOperationOfQuestions(query: OperationOfQuestionSearchQuery): Future[OperationOfQuestionSearchResult]
55   def indexOperationOfQuestion(record: IndexedOperationOfQuestion, maybeIndex: Option[Index]): Future[IndexationStatus]
56   def indexOperationOfQuestions(
57     records: Seq[IndexedOperationOfQuestion],
58     maybeIndex: Option[Index]
59   ): Future[IndexationStatus]
60   def highlights(): Future[Highlights]
61 }
62 
63 object OperationOfQuestionSearchEngine {
64   val operationOfQuestionIndexName: String = "operation-of-question"
65 }
66 
67 trait DefaultOperationOfQuestionSearchEngineComponent
68     extends OperationOfQuestionSearchEngineComponent
69     with CirceFormatters
70     with Logging {
71   self: ElasticsearchConfigurationComponent with ElasticsearchClientComponent =>
72 
73   override lazy val elasticsearchOperationOfQuestionAPI: OperationOfQuestionSearchEngine =
74     new DefaultOperationOfQuestionSearchEngine
75 
76   class DefaultOperationOfQuestionSearchEngine extends OperationOfQuestionSearchEngine {
77 
78     private lazy val client = elasticsearchClient.client
79 
80     private val operationOfQuestionAlias: Index =
81       elasticsearchConfiguration.operationOfQuestionAliasName
82 
83     // TODO remove once elastic4s-circe upgrades to circe 0.14
84     private implicit val printer: Json => String = Printer.noSpaces.print
85 
86     override def findOperationOfQuestionById(questionId: QuestionId): Future[Option[IndexedOperationOfQuestion]] = {
87       client
88         .executeAsFuture(get(operationOfQuestionAlias, questionId.value))
89         .map(_.toOpt[IndexedOperationOfQuestion])
90     }
91 
92     override def count(query: OperationOfQuestionSearchQuery): Future[Long] = {
93       val request = search(operationOfQuestionAlias)
94         .bool(BoolQuery(must = OperationOfQuestionSearchFilters.getOperationOfQuestionSearchFilters(query)))
95         .limit(0)
96         .trackTotalHits(true)
97 
98       client.executeAsFuture(request).map { response =>
99         response.totalHits
100       }
101     }
102 
103     override def searchOperationOfQuestions(
104       query: OperationOfQuestionSearchQuery
105     ): Future[OperationOfQuestionSearchResult] = {
106       val searchFilters = OperationOfQuestionSearchFilters.getOperationOfQuestionSearchFilters(query)
107       val request: SearchRequest = search(operationOfQuestionAlias)
108         .bool(BoolQuery(must = searchFilters))
109         .sortBy(
110           Seq(
111             OperationOfQuestionSearchFilters.getSort(query),
112             Some(FieldSort(field = OperationOfQuestionElasticsearchFieldName.endDate.field, order = SortOrder.DESC)),
113             Some(FieldSort(field = OperationOfQuestionElasticsearchFieldName.startDate.field, order = SortOrder.DESC))
114           ).flatten
115         )
116         .size(OperationOfQuestionSearchFilters.getLimitSearch(query))
117         .from(OperationOfQuestionSearchFilters.getSkipSearch(query))
118         .trackTotalHits(true)
119 
120       val requestWithAlgorithm = query.sortAlgorithm match {
121         case Some(algorithm) => algorithm.sortDefinition(request)
122         case _               => request
123       }
124 
125       client
126         .executeAsFuture(requestWithAlgorithm)
127         .map { response =>
128           OperationOfQuestionSearchResult(total = response.totalHits, results = response.to[IndexedOperationOfQuestion])
129         }
130     }
131 
132     override def indexOperationOfQuestion(
133       record: IndexedOperationOfQuestion,
134       maybeIndex: Option[Index]
135     ): Future[IndexationStatus] = {
136       val index = maybeIndex.getOrElse(operationOfQuestionAlias)
137       client
138         .executeAsFuture(indexInto(index).doc(record).refresh(RefreshPolicy.IMMEDIATE).id(record.questionId.value))
139         .map(_ => IndexationStatus.Completed)
140         .recover {
141           case e: Exception =>
142             logger.error(s"Indexing upserted operation of question ${record.questionId} failed", e)
143             IndexationStatus.Failed(e)
144         }
145     }
146 
147     override def indexOperationOfQuestions(
148       records: Seq[IndexedOperationOfQuestion],
149       maybeIndex: Option[Index]
150     ): Future[IndexationStatus] = {
151       val index = maybeIndex.getOrElse(operationOfQuestionAlias)
152       client
153         .executeAsFuture(bulk(records.map { record =>
154           indexInto(index).doc(record).refresh(RefreshPolicy.IMMEDIATE).id(record.questionId.value)
155         }))
156         .as(IndexationStatus.Completed)
157         .recover {
158           case e: Exception =>
159             logger.error(s"Indexing ${records.size} operations of questions failed", e)
160             IndexationStatus.Failed(e)
161         }
162     }
163 
164     override def highlights(): Future[Highlights] = {
165       client
166         .executeAsFuture(
167           search(operationOfQuestionAlias)
168             .aggregations(
169               sumAgg(
170                 OperationOfQuestionElasticsearchFieldName.participantsCount.field,
171                 OperationOfQuestionElasticsearchFieldName.participantsCount.field
172               ),
173               sumAgg(
174                 OperationOfQuestionElasticsearchFieldName.proposalsCount.field,
175                 OperationOfQuestionElasticsearchFieldName.proposalsCount.field
176               )
177             )
178             .trackTotalHits(true)
179         )
180         .map { response =>
181           Highlights(
182             participantsCount = response.aggregations
183               .sum(OperationOfQuestionElasticsearchFieldName.participantsCount.field)
184               .valueOpt
185               .fold(0)(_.toInt),
186             proposalsCount = response.aggregations
187               .sum(OperationOfQuestionElasticsearchFieldName.proposalsCount.field)
188               .valueOpt
189               .fold(0)(_.toInt),
190             partnersCount = 0
191           )
192         }
193     }
194   }
195 }
Line Stmt Id Pos Tree Symbol Tests Code
64 7956 2641 - 2664 Literal <nosymbol> "operation-of-question"
81 8610 3244 - 3299 ApplyImplicitView com.sksamuel.elastic4s.Index.toIndex org.scalatest.testsuite elastic4s.this.Index.toIndex(DefaultOperationOfQuestionSearchEngineComponent.this.elasticsearchConfiguration.operationOfQuestionAliasName)
84 8377 3415 - 3437 Apply io.circe.Printer.print io.circe.Printer.noSpaces.print(json)
88 8696 3593 - 3593 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
88 8271 3594 - 3641 Apply com.sksamuel.elastic4s.api.GetApi.get org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.get(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias, questionId.value)
88 7900 3593 - 3593 Select com.sksamuel.elastic4s.handlers.get.GetHandlers.GetHandler org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.GetHandler
88 8644 3624 - 3640 Select org.make.core.question.QuestionId.value org.scalatest.testsuite questionId.value
88 8028 3598 - 3622 Select org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.operationOfQuestionAlias org.scalatest.testsuite DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias
88 8302 3593 - 3593 Apply scala.reflect.ManifestFactory.classType org.scalatest.testsuite scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.get.GetResponse](classOf[com.sksamuel.elastic4s.requests.get.GetResponse])
89 8029 3655 - 3655 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
89 8561 3663 - 3663 ApplyToImplicitArgs com.sksamuel.elastic4s.circe.hitReaderWithCirce com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec)
89 8618 3562 - 3692 ApplyToImplicitArgs scala.concurrent.Future.map org.scalatest.testsuite org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.get.GetRequest, com.sksamuel.elastic4s.requests.get.GetResponse](com.sksamuel.elastic4s.ElasticDsl.get(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias, questionId.value))(com.sksamuel.elastic4s.ElasticDsl.GetHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.get.GetResponse](classOf[com.sksamuel.elastic4s.requests.get.GetResponse])).map[Option[org.make.core.operation.indexed.IndexedOperationOfQuestion]](((x$1: com.sksamuel.elastic4s.requests.get.GetResponse) => x$1.toOpt[org.make.core.operation.indexed.IndexedOperationOfQuestion](com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec))))(scala.concurrent.ExecutionContext.Implicits.global)
89 7959 3663 - 3663 Select org.make.core.operation.indexed.IndexedOperationOfQuestion.codec indexed.this.IndexedOperationOfQuestion.codec
89 8380 3656 - 3691 ApplyToImplicitArgs com.sksamuel.elastic4s.Hit.toOpt x$1.toOpt[org.make.core.operation.indexed.IndexedOperationOfQuestion](com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec))
96 8276 3800 - 3989 Apply com.sksamuel.elastic4s.requests.searches.SearchRequest.trackTotalHits org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.search(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias).bool({ <artifact> val x$1: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = org.make.core.operation.OperationOfQuestionSearchFilters.getOperationOfQuestionSearchFilters(query); <artifact> val x$2: Option[Boolean] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$1; <artifact> val x$3: Option[Double] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$2; <artifact> val x$4: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$3; <artifact> val x$5: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$4; <artifact> val x$6: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$5; <artifact> val x$7: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$7; <artifact> val x$8: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$8; com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply(x$2, x$3, x$4, x$5, x$6, x$1, x$7, x$8) }).limit(0).trackTotalHits(true)
98 8698 4019 - 4019 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
98 8369 3997 - 4081 ApplyToImplicitArgs scala.concurrent.Future.map org.scalatest.testsuite org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.searches.SearchRequest, com.sksamuel.elastic4s.requests.searches.SearchResponse](request)(com.sksamuel.elastic4s.ElasticDsl.SearchHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])).map[Long](((response: com.sksamuel.elastic4s.requests.searches.SearchResponse) => response.totalHits))(scala.concurrent.ExecutionContext.Implicits.global)
98 8306 4019 - 4019 Apply scala.reflect.ManifestFactory.classType org.scalatest.testsuite scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])
98 8563 4033 - 4033 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
98 7881 4019 - 4019 Select com.sksamuel.elastic4s.requests.searches.SearchHandlers.SearchHandler org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.SearchHandler
99 7934 4055 - 4073 Select com.sksamuel.elastic4s.requests.searches.SearchResponse.totalHits response.totalHits
106 8043 4255 - 4330 Apply org.make.core.operation.OperationOfQuestionSearchFilters.getOperationOfQuestionSearchFilters org.scalatest.testsuite org.make.core.operation.OperationOfQuestionSearchFilters.getOperationOfQuestionSearchFilters(query)
118 8623 4366 - 4974 Apply com.sksamuel.elastic4s.requests.searches.SearchRequest.trackTotalHits org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.search(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias).bool({ <artifact> val x$1: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = searchFilters; <artifact> val x$2: Option[Boolean] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$1; <artifact> val x$3: Option[Double] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$2; <artifact> val x$4: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$3; <artifact> val x$5: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$4; <artifact> val x$6: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$5; <artifact> val x$7: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$7; <artifact> val x$8: Seq[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply$default$8; com.sksamuel.elastic4s.requests.searches.queries.compound.BoolQuery.apply(x$2, x$3, x$4, x$5, x$6, x$1, x$7, x$8) }).sortBy(scala.`package`.Seq.apply[Option[com.sksamuel.elastic4s.requests.searches.sort.FieldSort]](org.make.core.operation.OperationOfQuestionSearchFilters.getSort(query), scala.Some.apply[com.sksamuel.elastic4s.requests.searches.sort.FieldSort]({ <artifact> val x$9: String = org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.endDate.field; <artifact> val x$10: com.sksamuel.elastic4s.requests.searches.sort.SortOrder = com.sksamuel.elastic4s.requests.searches.sort.SortOrder.DESC; <artifact> val x$11: Option[Any] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$2; <artifact> val x$12: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$3; <artifact> val x$13: Option[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$4; <artifact> val x$14: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$5; <artifact> val x$15: Option[com.sksamuel.elastic4s.requests.searches.sort.SortMode] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$6; <artifact> val x$16: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$8; <artifact> val x$17: Option[com.sksamuel.elastic4s.requests.searches.sort.NestedSort] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$9; com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply(x$9, x$11, x$12, x$13, x$14, x$15, x$10, x$16, x$17) }), scala.Some.apply[com.sksamuel.elastic4s.requests.searches.sort.FieldSort]({ <artifact> val x$18: String = org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.startDate.field; <artifact> val x$19: com.sksamuel.elastic4s.requests.searches.sort.SortOrder = com.sksamuel.elastic4s.requests.searches.sort.SortOrder.DESC; <artifact> val x$20: Option[Any] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$2; <artifact> val x$21: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$3; <artifact> val x$22: Option[com.sksamuel.elastic4s.requests.searches.queries.Query] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$4; <artifact> val x$23: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$5; <artifact> val x$24: Option[com.sksamuel.elastic4s.requests.searches.sort.SortMode] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$6; <artifact> val x$25: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$8; <artifact> val x$26: Option[com.sksamuel.elastic4s.requests.searches.sort.NestedSort] @scala.reflect.internal.annotations.uncheckedBounds = com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply$default$9; com.sksamuel.elastic4s.requests.searches.sort.FieldSort.apply(x$18, x$20, x$21, x$22, x$23, x$24, x$19, x$25, x$26) })).flatten[com.sksamuel.elastic4s.requests.searches.sort.FieldSort](scala.Predef.$conforms[Option[com.sksamuel.elastic4s.requests.searches.sort.FieldSort]])).size(org.make.core.operation.OperationOfQuestionSearchFilters.getLimitSearch(query)).from(org.make.core.operation.OperationOfQuestionSearchFilters.getSkipSearch(query)).trackTotalHits(true)
120 8264 5009 - 5028 Select org.make.core.operation.OperationOfQuestionSearchQuery.sortAlgorithm org.scalatest.testsuite query.sortAlgorithm
121 7884 5069 - 5102 Apply org.make.core.operation.SortAlgorithm.sortDefinition org.scalatest.testsuite algorithm.sortDefinition(request)
126 8352 5189 - 5189 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
126 7936 5189 - 5189 Apply scala.reflect.ManifestFactory.classType org.scalatest.testsuite scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])
126 8701 5189 - 5189 Select com.sksamuel.elastic4s.requests.searches.SearchHandlers.SearchHandler org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.SearchHandler
127 8731 5158 - 5369 ApplyToImplicitArgs scala.concurrent.Future.map org.scalatest.testsuite org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.searches.SearchRequest, com.sksamuel.elastic4s.requests.searches.SearchResponse](requestWithAlgorithm)(com.sksamuel.elastic4s.ElasticDsl.SearchHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])).map[org.make.core.operation.indexed.OperationOfQuestionSearchResult](((response: com.sksamuel.elastic4s.requests.searches.SearchResponse) => org.make.core.operation.indexed.OperationOfQuestionSearchResult.apply(response.totalHits, response.to[org.make.core.operation.indexed.IndexedOperationOfQuestion](com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec), (ClassTag.apply[org.make.core.operation.indexed.IndexedOperationOfQuestion](classOf[org.make.core.operation.indexed.IndexedOperationOfQuestion]): scala.reflect.ClassTag[org.make.core.operation.indexed.IndexedOperationOfQuestion])))))(scala.concurrent.ExecutionContext.Implicits.global)
127 7914 5225 - 5225 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
128 8666 5319 - 5358 ApplyToImplicitArgs com.sksamuel.elastic4s.requests.searches.SearchResponse.to response.to[org.make.core.operation.indexed.IndexedOperationOfQuestion](com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec), (ClassTag.apply[org.make.core.operation.indexed.IndexedOperationOfQuestion](classOf[org.make.core.operation.indexed.IndexedOperationOfQuestion]): scala.reflect.ClassTag[org.make.core.operation.indexed.IndexedOperationOfQuestion]))
128 8268 5249 - 5359 Apply org.make.core.operation.indexed.OperationOfQuestionSearchResult.apply org.make.core.operation.indexed.OperationOfQuestionSearchResult.apply(response.totalHits, response.to[org.make.core.operation.indexed.IndexedOperationOfQuestion](com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec), (ClassTag.apply[org.make.core.operation.indexed.IndexedOperationOfQuestion](classOf[org.make.core.operation.indexed.IndexedOperationOfQuestion]): scala.reflect.ClassTag[org.make.core.operation.indexed.IndexedOperationOfQuestion])))
128 8048 5330 - 5330 ApplyToImplicitArgs com.sksamuel.elastic4s.circe.hitReaderWithCirce com.sksamuel.elastic4s.circe.`package`.hitReaderWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec)
128 8589 5289 - 5307 Select com.sksamuel.elastic4s.requests.searches.SearchResponse.totalHits response.totalHits
128 8206 5330 - 5330 Select org.make.core.operation.indexed.IndexedOperationOfQuestion.codec indexed.this.IndexedOperationOfQuestion.codec
136 8357 5569 - 5593 Select org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.operationOfQuestionAlias DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias
136 7982 5548 - 5594 Apply scala.Option.getOrElse maybeIndex.getOrElse[com.sksamuel.elastic4s.Index](DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias)
138 8594 5653 - 5653 Select org.make.core.operation.indexed.IndexedOperationOfQuestion.codec indexed.this.IndexedOperationOfQuestion.codec
138 8253 5698 - 5721 Select org.make.core.question.QuestionId.value record.questionId.value
138 8537 5632 - 5632 Select com.sksamuel.elastic4s.handlers.index.IndexHandlers.IndexHandler com.sksamuel.elastic4s.ElasticDsl.IndexHandler
138 8235 5653 - 5653 Select org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.printer DefaultOperationOfQuestionSearchEngine.this.printer
138 8668 5670 - 5693 Select com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE
138 8040 5653 - 5653 ApplyToImplicitArgs com.sksamuel.elastic4s.circe.indexableWithCirce com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)
138 7947 5632 - 5632 Apply scala.reflect.ManifestFactory.classType scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.indexes.IndexResponse](classOf[com.sksamuel.elastic4s.requests.indexes.IndexResponse])
138 7917 5633 - 5722 Apply com.sksamuel.elastic4s.requests.indexes.IndexRequest.id com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value)
138 8341 5632 - 5632 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
139 8199 5736 - 5736 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
139 8599 5742 - 5768 Select org.make.core.elasticsearch.IndexationStatus.Completed org.make.core.elasticsearch.IndexationStatus.Completed
140 8256 5787 - 5787 Apply org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.$anonfun.<init> new $anonfun()
140 7921 5787 - 5787 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
140 8520 5601 - 5968 ApplyToImplicitArgs scala.concurrent.Future.recover org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.indexes.IndexRequest, com.sksamuel.elastic4s.requests.indexes.IndexResponse](com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value))(com.sksamuel.elastic4s.ElasticDsl.IndexHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.indexes.IndexResponse](classOf[com.sksamuel.elastic4s.requests.indexes.IndexResponse])).map[org.make.core.elasticsearch.IndexationStatus.Completed.type](((x$2: com.sksamuel.elastic4s.requests.indexes.IndexResponse) => org.make.core.elasticsearch.IndexationStatus.Completed))(scala.concurrent.ExecutionContext.Implicits.global).recover[org.make.core.elasticsearch.IndexationStatus](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[Throwable,org.make.core.elasticsearch.IndexationStatus] with java.io.Serializable { def <init>(): <$anon: Throwable => org.make.core.elasticsearch.IndexationStatus> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: Throwable, B1 >: org.make.core.elasticsearch.IndexationStatus](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[Throwable]: Throwable): Throwable @unchecked) match { case (e @ (_: Exception)) => { DefaultOperationOfQuestionSearchEngineComponent.this.logger.error(("Indexing upserted operation of question ".+(record.questionId).+(" failed"): String), e); org.make.core.elasticsearch.IndexationStatus.Failed.apply(e) } case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: Throwable): Boolean = ((x1.asInstanceOf[Throwable]: Throwable): Throwable @unchecked) match { case (e @ (_: Exception)) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[Throwable,org.make.core.elasticsearch.IndexationStatus]))(scala.concurrent.ExecutionContext.Implicits.global)
142 8018 5832 - 5919 Apply grizzled.slf4j.Logger.error DefaultOperationOfQuestionSearchEngineComponent.this.logger.error(("Indexing upserted operation of question ".+(record.questionId).+(" failed"): String), e)
143 8648 5932 - 5958 Apply org.make.core.elasticsearch.IndexationStatus.Failed.apply org.make.core.elasticsearch.IndexationStatus.Failed.apply(e)
151 7944 6154 - 6200 Apply scala.Option.getOrElse maybeIndex.getOrElse[com.sksamuel.elastic4s.Index](DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias)
151 8323 6175 - 6199 Select org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.operationOfQuestionAlias DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias
153 8831 6207 - 6379 ApplyToImplicitArgs org.make.api.technical.elasticsearch.RichHttpClient.executeAsFuture org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.bulk.BulkRequest, com.sksamuel.elastic4s.requests.bulk.BulkResponse](com.sksamuel.elastic4s.ElasticDsl.bulk(records.map[com.sksamuel.elastic4s.requests.indexes.IndexRequest](((record: org.make.core.operation.indexed.IndexedOperationOfQuestion) => com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value)))))(com.sksamuel.elastic4s.ElasticDsl.BulkHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.bulk.BulkResponse](classOf[com.sksamuel.elastic4s.requests.bulk.BulkResponse]))
153 8645 6238 - 6238 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
153 8295 6238 - 6238 ApplyToImplicitArgs cats.instances.FutureInstances.catsStdInstancesForFuture cats.implicits.catsStdInstancesForFuture(scala.concurrent.ExecutionContext.Implicits.global)
153 7980 6238 - 6238 Select com.sksamuel.elastic4s.handlers.bulk.BulkHandlers.BulkHandler com.sksamuel.elastic4s.ElasticDsl.BulkHandler
153 8584 6238 - 6238 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
153 8309 6239 - 6378 Apply com.sksamuel.elastic4s.api.BulkApi.bulk com.sksamuel.elastic4s.ElasticDsl.bulk(records.map[com.sksamuel.elastic4s.requests.indexes.IndexRequest](((record: org.make.core.operation.indexed.IndexedOperationOfQuestion) => com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value))))
153 8524 6244 - 6377 Apply scala.collection.IterableOps.map records.map[com.sksamuel.elastic4s.requests.indexes.IndexRequest](((record: org.make.core.operation.indexed.IndexedOperationOfQuestion) => com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value)))
153 8186 6238 - 6238 Apply scala.reflect.ManifestFactory.classType scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.bulk.BulkResponse](classOf[com.sksamuel.elastic4s.requests.bulk.BulkResponse])
154 7999 6298 - 6298 ApplyToImplicitArgs com.sksamuel.elastic4s.circe.indexableWithCirce com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)
154 8663 6315 - 6338 Select com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE
154 7870 6278 - 6367 Apply com.sksamuel.elastic4s.requests.indexes.IndexRequest.id com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value)
154 8581 6298 - 6298 Select org.make.core.operation.indexed.IndexedOperationOfQuestion.codec indexed.this.IndexedOperationOfQuestion.codec
154 8204 6298 - 6298 Select org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.printer DefaultOperationOfQuestionSearchEngine.this.printer
154 8260 6343 - 6366 Select org.make.core.question.QuestionId.value record.questionId.value
156 7873 6392 - 6418 Select org.make.core.elasticsearch.IndexationStatus.Completed org.make.core.elasticsearch.IndexationStatus.Completed
157 7984 6437 - 6437 Apply org.make.api.operation.DefaultOperationOfQuestionSearchEngineComponent.DefaultOperationOfQuestionSearchEngine.$anonfun.<init> new $anonfun()
157 8188 6207 - 6606 ApplyToImplicitArgs scala.concurrent.Future.recover cats.implicits.toFunctorOps[scala.concurrent.Future, com.sksamuel.elastic4s.requests.bulk.BulkResponse](org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.bulk.BulkRequest, com.sksamuel.elastic4s.requests.bulk.BulkResponse](com.sksamuel.elastic4s.ElasticDsl.bulk(records.map[com.sksamuel.elastic4s.requests.indexes.IndexRequest](((record: org.make.core.operation.indexed.IndexedOperationOfQuestion) => com.sksamuel.elastic4s.ElasticDsl.indexInto(index).doc[org.make.core.operation.indexed.IndexedOperationOfQuestion](record)(com.sksamuel.elastic4s.circe.`package`.indexableWithCirce[org.make.core.operation.indexed.IndexedOperationOfQuestion](indexed.this.IndexedOperationOfQuestion.codec, DefaultOperationOfQuestionSearchEngine.this.printer)).refresh(com.sksamuel.elastic4s.requests.common.RefreshPolicy.IMMEDIATE).id(record.questionId.value)))))(com.sksamuel.elastic4s.ElasticDsl.BulkHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.bulk.BulkResponse](classOf[com.sksamuel.elastic4s.requests.bulk.BulkResponse])))(cats.implicits.catsStdInstancesForFuture(scala.concurrent.ExecutionContext.Implicits.global)).as[org.make.core.elasticsearch.IndexationStatus.Completed.type](org.make.core.elasticsearch.IndexationStatus.Completed).recover[org.make.core.elasticsearch.IndexationStatus](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[Throwable,org.make.core.elasticsearch.IndexationStatus] with java.io.Serializable { def <init>(): <$anon: Throwable => org.make.core.elasticsearch.IndexationStatus> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: Throwable, B1 >: org.make.core.elasticsearch.IndexationStatus](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[Throwable]: Throwable): Throwable @unchecked) match { case (e @ (_: Exception)) => { DefaultOperationOfQuestionSearchEngineComponent.this.logger.error(("Indexing ".+(records.size).+(" operations of questions failed"): String), e); org.make.core.elasticsearch.IndexationStatus.Failed.apply(e) } case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: Throwable): Boolean = ((x1.asInstanceOf[Throwable]: Throwable): Throwable @unchecked) match { case (e @ (_: Exception)) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[Throwable,org.make.core.elasticsearch.IndexationStatus]))(scala.concurrent.ExecutionContext.Implicits.global)
157 8577 6437 - 6437 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
159 8500 6482 - 6557 Apply grizzled.slf4j.Logger.error DefaultOperationOfQuestionSearchEngineComponent.this.logger.error(("Indexing ".+(records.size).+(" operations of questions failed"): String), e)
160 8340 6570 - 6596 Apply org.make.core.elasticsearch.IndexationStatus.Failed.apply org.make.core.elasticsearch.IndexationStatus.Failed.apply(e)
166 7903 6705 - 6705 Apply scala.reflect.ManifestFactory.classType org.scalatest.testsuite scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])
166 8649 6705 - 6705 Select com.sksamuel.elastic4s.requests.searches.SearchHandlers.SearchHandler org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.SearchHandler
166 8296 6705 - 6705 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
178 8812 6717 - 7225 Apply com.sksamuel.elastic4s.requests.searches.SearchRequest.trackTotalHits org.scalatest.testsuite com.sksamuel.elastic4s.ElasticDsl.search(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias).aggregations(com.sksamuel.elastic4s.ElasticDsl.sumAgg(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field, org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field), com.sksamuel.elastic4s.ElasticDsl.sumAgg(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field, org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field)).trackTotalHits(true)
180 7964 6674 - 7724 ApplyToImplicitArgs scala.concurrent.Future.map org.scalatest.testsuite org.make.api.technical.elasticsearch.`package`.RichHttpClient(DefaultOperationOfQuestionSearchEngine.this.client).executeAsFuture[com.sksamuel.elastic4s.requests.searches.SearchRequest, com.sksamuel.elastic4s.requests.searches.SearchResponse](com.sksamuel.elastic4s.ElasticDsl.search(DefaultOperationOfQuestionSearchEngine.this.operationOfQuestionAlias).aggregations(com.sksamuel.elastic4s.ElasticDsl.sumAgg(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field, org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field), com.sksamuel.elastic4s.ElasticDsl.sumAgg(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field, org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field)).trackTotalHits(true))(com.sksamuel.elastic4s.ElasticDsl.SearchHandler, scala.concurrent.ExecutionContext.Implicits.global, scala.reflect.ManifestFactory.classType[com.sksamuel.elastic4s.requests.searches.SearchResponse](classOf[com.sksamuel.elastic4s.requests.searches.SearchResponse])).map[org.make.api.views.Highlights](((response: com.sksamuel.elastic4s.requests.searches.SearchResponse) => org.make.api.views.Highlights.apply(response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field).valueOpt.fold[Int](0)(((x$3: Double) => x$3.toInt)), response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field).valueOpt.fold[Int](0)(((x$4: Double) => x$4.toInt)), 0)))(scala.concurrent.ExecutionContext.Implicits.global)
180 8155 7249 - 7249 Select scala.concurrent.ExecutionContext.Implicits.global org.scalatest.testsuite scala.concurrent.ExecutionContext.Implicits.global
181 8539 7273 - 7714 Apply org.make.api.views.Highlights.apply org.make.api.views.Highlights.apply(response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field).valueOpt.fold[Int](0)(((x$3: Double) => x$3.toInt)), response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field).valueOpt.fold[Int](0)(((x$4: Double) => x$4.toInt)), 0)
183 8507 7358 - 7423 Select org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.Simple.field org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field
185 8343 7469 - 7470 Literal <nosymbol> 0
185 8582 7317 - 7480 Apply scala.Option.fold response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.participantsCount.field).valueOpt.fold[Int](0)(((x$3: Double) => x$3.toInt))
185 7962 7472 - 7479 Select scala.Double.toInt x$3.toInt
187 8224 7552 - 7614 Select org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.Simple.field org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field
189 8651 7663 - 7670 Select scala.Double.toInt x$4.toInt
189 8842 7660 - 7661 Literal <nosymbol> 0
189 8246 7511 - 7671 Apply scala.Option.fold response.aggregations.sum(org.make.core.operation.indexed.OperationOfQuestionElasticsearchFieldName.proposalsCount.field).valueOpt.fold[Int](0)(((x$4: Double) => x$4.toInt))
190 7907 7701 - 7702 Literal <nosymbol> 0