Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
import org.apache.solr.SolrTestCaseJ4; | |
import org.apache.solr.client.solrj.SolrServerException; | |
import org.junit.BeforeClass; | |
import org.junit.Test; | |
import java.io.IOException; | |
public class BasicConfigurationTest extends SolrTestCaseJ4 { | |
@BeforeClass | |
public static void init() throws Exception { |
import com.github.nicholasren.moco.dsl.Conversions._ | |
import com.github.nicholasren.moco.dsl.SMoco | |
import com.github.nicholasren.moco.dsl.SMoco._ | |
import org.apache.http.client.fluent.Request | |
import org.scalatest.{BeforeAndAfter, FunSpec} | |
class ScalaMocoTest extends FunSpec with BeforeAndAfter { | |
var theServer: SMoco = null |
/** | |
* This file is licensed to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
/** | |
* This file is licensed to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
// simple example of the cake pattern | |
// abstract DAO trait | |
trait Repository[A, B]{ | |
// saves an entity, returns an ID | |
def save(entity: A): B | |
// more features.. | |
} | |
trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
case class Account(name:String, username:String, password:String) |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
# Index | |
--------------------------------------------------------------------- | |
curl -XPUT http://localhost:9200/pictures/ -d ' | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"index_analyzer": { | |
"tokenizer": "standard", |
version := "0.1" | |
scalaVersion := "2.11.7" | |
val versionOfAkka = "2.3.13" | |
val versionOfKafka = "0.8.2.0" | |
libraryDependencies ++= Seq( | |
"org.apache.kafka" % "kafka-clients" % versionOfKafka exclude("org.slf4j", "slf4j-log4j12") withSources(), |
package demo | |
import akka.actor.Actor | |
import akka.actor.FSM | |
import akka.actor.ActorSystem | |
import akka.actor.Props | |
import akka.actor.ActorRef | |
sealed trait State | |
case object Awake extends State |