Skip to content

Commit

Permalink
#127 Exclude report content of job when using search API
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Feb 22, 2017
1 parent 3f086bf commit b3c920e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import play.api.routing.sird.{ DELETE, GET, PATCH, POST, UrlContext }
import org.elastic4play.{ BadRequestError, NotFoundError, Timed }
import org.elastic4play.controllers.{ Authenticated, FieldsBodyParser, Renderer }
import org.elastic4play.models.JsonFormat.baseModelEntityWrites
import org.elastic4play.services.{ QueryDef, QueryDSL, Role }
import org.elastic4play.services.{ AuxSrv, QueryDef, QueryDSL, Role }
import org.elastic4play.services.JsonFormat.queryReads

import connectors.Connector
Expand All @@ -26,6 +26,7 @@ class CortextCtrl @Inject() (
reportTemplateCtrl: ReportTemplateCtrl,
cortexConfig: CortexConfig,
cortexSrv: CortexSrv,
auxSrv: AuxSrv,
authenticated: Authenticated,
fieldsBodyParser: FieldsBodyParser,
renderer: Renderer,
Expand Down Expand Up @@ -74,7 +75,8 @@ class CortextCtrl @Inject() (
val sort = request.body.getStrings("sort").getOrElse(Nil)

val (jobs, total) = cortexSrv.find(query, range, sort)
renderer.toOutput(OK, jobs, total)
val jobWithoutReport = auxSrv.apply(jobs, 0, false, true)
renderer.toOutput(OK, jobWithoutReport, total)
}

@Timed
Expand Down

0 comments on commit b3c920e

Please sign in to comment.