Create Index
curl -XPUT 'localhost:9200/auto?pretty' -H 'Content-Type: application/json' -d'
{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"car" : {
// build.sbt | |
val slick = Seq( | |
"com.typesafe.slick" %% "slick" % "3.2.1", | |
"org.slf4j" % "slf4j-nop" % "1.6.4", | |
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.1", | |
"com.h2database" % "h2" % "1.4.196" | |
) | |
val scalaz = Seq( | |
"org.scalaz" %% "scalaz-core" % "7.2.17" | |
) |
Create Index
curl -XPUT 'localhost:9200/auto?pretty' -H 'Content-Type: application/json' -d'
{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"car" : {
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, Future} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.util.{Failure, Success, Try} | |
object Main { | |
def main(args: Array[String]): Unit = { | |
val seq = Seq(Future("a"), Future("b"), Future(throw new NullPointerException("abc")), Future("c")) |
trait TestCo { | |
type CoVariant[+T, _ <: Exception] | |
def unwrap[T](value: => CoVariant[T, _ <: Exception]): T | |
} | |
// works fine, since Option is covariant | |
class TestCoImpl extends TestCo { | |
type CoVariant[+T, _ <: Exception] = Option[T] | |
def unwrap[T](value: => CoVariant[T, _ <: Exception]): T = value.get | |
} |
//Controller | |
import play.api.mvc.{Action, Controller} | |
class HelloWorldController extends Controller { | |
def helloWorld() = Action { | |
Ok("Hello World") | |
} |