Skip to content

Instantly share code, notes, and snippets.

import com.twitter.util.{Future => TwFuture}
import scala.concurrent.{Future => ScFuture, promise => ScPromise}
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = {
val prom = ScPromise[T]
twFuture.onSuccess { res: T =>
prom.success(res)
}
twFuture.onFailure { t: Throwable =>
prom.failure(t)
}
curl localhost:9200/_search -d '{
"query" : {
"filtered" : {
"query" : {"match_all" : {}},
"filter" : {
"or" : [
{
"range" : {
"file_size" : {"from" : 10, "to" : 10000}
}