Skip to content

Instantly share code, notes, and snippets.

@ferromir
Created September 16, 2014 00:13
Show Gist options
  • Save ferromir/8da462c44a1cb41f2466 to your computer and use it in GitHub Desktop.
Save ferromir/8da462c44a1cb41f2466 to your computer and use it in GitHub Desktop.
Usage of spray directives
def listQueryHistogram(username: String, focussetId: String) =
(ekhoAuth(GET, Some(username), Some(focussetId)) &
params &
parameters('queries) &
detach())
{
// The first two are the values extracted by params and parameterers directives
(params, queries) => ctx =>
val theList = queries.split(",").toList
val groups = ElasticsearchFilteredAggHelper.multiTextQueryAgg(focussetId = focussetId,
interval = params.interval, query = params.query,
fromDate = params.fromDate, toDate = params.toDate,
preZone = params.preZone, postZone = params.postZone,
filterList = theList )
ctx.complete(groups)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment