Skip to content

Instantly share code, notes, and snippets.

{
"index" : {
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"version" : "3.0"
}
}
}
curl -XPUT localhost:9200/_settings -d '{
"index.translog.flush_threshold_ops" : 9999999,
"index.translog.flush_threshold_size" : "9999gb",
"index.translog.flush_threshold_period" : "999999h"
}'
// copy over the three nodes now
// now, restore to default settings
curl -XPUT localhost:9200/_settings -d '{
curl -s -X GET 'http://localhost:9200/hshvsubs_index/_search?pretty=true' -d '
{
"query" : {
"filtered" :
{
"query" : {
"query_string" :
{
"query" : "unable"
}
/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/bin/java -server -Xmx1g -Des-foreground=yes -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Didea.launcher.port=7536 -Didea.launcher.bin.path=/Applications/IntelliJ IDEA 10.app/bin -Dfile.encoding=UTF-8 -classpath /System/Library/Java/Support/CoreDeploy.bundle/Contents/Resources/Java/deploy.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/javaws.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/lib/jce.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java/plugin.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/1.6.0_24-b07-334.jdk/Contents/Classes/alt-rt.jar:/
curl -XGET 'http://localhost:9200/orchard/lemon/_search?pretty=True' -d '
{
"query" : {
"field" : { "name" : "*" }
},
"script_fields" : {
"dist" : {
"lang" : "js",
"script" : "doc.location.distance(32.7, -117.1)"
}
curl localhost:9200/_search -d '{
"query" : {
"filtered" : {
"query" : {"match_all" : {}},
"filter" : {
"and" : [
{
"range" : {
"file_size" : {"from" : 10, "to" : 10000}
}
curl -XPUT 'http://localhost:9200/twitter/'
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '{
"tweet" : {
"properties" : {
"pin": {
"properties": {
"location": {
"type": "geo_point"
}
In order to satisfy the requirements, the first thing we are going to do is create an index, and have mappings associated with the `properties` type:
curl -XPUT localhost:9200/foo -d '{
"settings" : {
"analysis" : {
"analyzer" : {
"stem" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "stop", "porter_stem"]
}
curl -XPUT 'http://localhost:9200/test1' -d '{
"mappings" : {
"entity" : {
"properties" : {
"Headline" : {
"type" : "string", "index" : "not_analyzed"
},
"Line1" : {
"type" : "string", "index" : "not_analyzed"
},
@kimchy
kimchy / gist:1078717
Created July 12, 2011 19:09
native memory leak with GarbageCollectorMXBean#getLastGcInfo
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.List;
public class TestMemoryLeak {
public static void main(String[] args) throws Exception {
while (true) {
List<GarbageCollectorMXBean> gcMxBeans = ManagementFactory.getGarbageCollectorMXBeans();
for (GarbageCollectorMXBean gcMxBean : gcMxBeans) {