Skip to content

Instantly share code, notes, and snippets.

@teroxik
teroxik / gist:32e421279b4652cfc04e
Created June 18, 2015 10:11
Queries + results
curl -X POST localhost:9200/estest/es -d '{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "AXN"
}
},
"filter": {
"bool": {
@teroxik
teroxik / gist:724ff71ccc79f52295fb
Last active August 29, 2015 14:23
Elastic search - testData
[
{
"_id" : "5527afb8e4b0d50e79bdd10d",
"assignedUsers" : [ ],
"comments" : [ ],
"itemData" : [
{
"_id" : "5527b076e4b03518b926ae93",
"ingest_status" : "requested",
"created" : "2015-04-10T11:13:58.749Z",
@teroxik
teroxik / gist:9522e97bddaa3eec34a9
Last active August 29, 2015 14:23
Elastic search - mapping
//mapping
{
"estest": {
"mappings": {
"es": {
"properties": {
"itemData": {
"type": "nested",
"properties": {
"_id": {
@teroxik
teroxik / ComplexNumber
Created April 9, 2013 20:59
Complex number implementation in Scala with various features of Scala language as coded at Czech Scala Enthusiasts' Scala coding dojo on Apr 9, 2013
package com.czechscala.blank
class ComplexNumber private(val x: Int, val y: Int) {
override def toString() = s"$x + ${y}i"
override def equals(c: Any) = c match {
case x : ComplexNumber => x.x == this.x && x.y == y
case _ => false
}