This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.elasticsearch.benchmark; | |
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; | |
import org.elasticsearch.discovery.MasterNotDiscoveredException; | |
import org.elasticsearch.node.Node; | |
import static org.elasticsearch.common.settings.ImmutableSettings.*; | |
import static org.elasticsearch.node.NodeBuilder.*; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect! | |
unless defined?(@@patron_session) | |
@@patron_session = Patron::Session.new | |
@session = @@patron_session | |
@session.base_url = @server | |
@session.timeout = @options[:timeout] | |
@session.headers['User-Agent'] = 'ElasticSearch.rb v0.1' | |
@session.headers['Connection'] = 'Keep-Alive' | |
else | |
@session = @@patron_session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query" : { | |
"filtered" : { | |
"query" : { | |
"match_all" : {} | |
}, | |
"filter" : { | |
"geo_distance" : { | |
"distance" : "200km", | |
"pin.location" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.lang.Binding; | |
import groovy.lang.GroovyClassLoader; | |
import groovy.lang.Script; | |
import org.mvel2.MVEL; | |
import java.io.Serializable; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class PerfTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET localhost:9200/_search?pretty=true -d '{ | |
"query" : { | |
"filtered" : { | |
"query" : { | |
"match_all" : {} | |
}, | |
"filter" : { | |
"term" : { | |
"_type" : "person" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT localhost:9200/test -d '{ | |
"mappings" : { | |
"child" : { | |
"_parent" : { | |
"type" : "parent" | |
} | |
} | |
} | |
}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.codehaus.jackson.JsonGenerator; | |
import org.codehaus.jackson.JsonParser; | |
import org.codehaus.jackson.smile.SmileFactory; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Test { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT localhost:9200/places -d '{ | |
"settings" : { | |
"index" : { | |
"analysis" : { | |
"analyzer" : { | |
"default" : { | |
"type" : "custom", | |
"tokenizer" : "whitespace", | |
"filter" : ["standard", "lowercase", "snowball"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT localhost:9200/local -d '{ | |
"settings" : { | |
"analysis" : { | |
"analyzer" : { | |
"stem" : { | |
"tokenizer" : "standard", | |
"filter" : ["standard", "lowercase", "stop", "porter_stem"] | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.edmunds.training.real_time_logger; | |
import java.io.IOException; | |
import org.elasticsearch.action.bulk.BulkResponse; | |
import org.elasticsearch.client.Client; | |
import org.elasticsearch.client.Requests; | |
import org.elasticsearch.client.action.bulk.BulkRequestBuilder; | |
import org.elasticsearch.client.transport.TransportClient; | |
import org.elasticsearch.common.transport.InetSocketTransportAddress; |