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
| { | |
| "index" : { | |
| "analysis" : { | |
| "analyzer" : { | |
| "default" : { | |
| "type" : "standard", | |
| "version" : "3.0" | |
| } | |
| } | |
| } |
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/_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 '{ |
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 -s -X GET 'http://localhost:9200/hshvsubs_index/_search?pretty=true' -d ' | |
| { | |
| "query" : { | |
| "filtered" : | |
| { | |
| "query" : { | |
| "query_string" : | |
| { | |
| "query" : "unable" | |
| } |
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
| /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:/ |
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 '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)" | |
| } |
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 localhost:9200/_search -d '{ | |
| "query" : { | |
| "filtered" : { | |
| "query" : {"match_all" : {}}, | |
| "filter" : { | |
| "and" : [ | |
| { | |
| "range" : { | |
| "file_size" : {"from" : 10, "to" : 10000} | |
| } |
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 'http://localhost:9200/twitter/' | |
| curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '{ | |
| "tweet" : { | |
| "properties" : { | |
| "pin": { | |
| "properties": { | |
| "location": { | |
| "type": "geo_point" | |
| } |
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
| 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"] | |
| } |
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 'http://localhost:9200/test1' -d '{ | |
| "mappings" : { | |
| "entity" : { | |
| "properties" : { | |
| "Headline" : { | |
| "type" : "string", "index" : "not_analyzed" | |
| }, | |
| "Line1" : { | |
| "type" : "string", "index" : "not_analyzed" | |
| }, |
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 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) { |