Skip to content

Instantly share code, notes, and snippets.

View gr0's full-sized avatar

Rafał Kuć gr0

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gr0 on github.
  • I am gr0 (https://keybase.io/gr0) on keybase.
  • I have a public key ASAJhTZ3RyW_P15uAkrGV_qI7NXxLnR6pYKxnAPsW8EsvQo

To claim this, I am signing this object:

@gr0
gr0 / gist:6422143
Created September 3, 2013 10:23
Simple usage of AND and OR filters combined in ElasticSearch.
curl -XPOST 'localhost:9200/docs/doc/1' -d '{"name":"test 1","age":10, "year": 1998}'
curl -XPOST 'localhost:9200/docs/doc/2' -d '{"name":"test 2","age":30, "year": 2012}'
curl -XPOST 'localhost:9200/docs/doc/3' -d '{"name":"test 3","age":40, "year": 1998}'
curl -XPOST 'localhost:9200/docs/doc/4' -d '{"name":"test 4","age":40, "year": 2013}'
curl -XGET 'localhost:9200/_search?pretty' -d '{
"query" : {
"match_all" : {}
},
"filter" : {
@gr0
gr0 / gist:6421981
Created September 3, 2013 10:05
Simple example of ElasticSearch OR filter.
curl -XPOST 'localhost:9200/docs/doc/1' -d '{"name":"test 1","age":10}'
curl -XPOST 'localhost:9200/docs/doc/2' -d '{"name":"test 2","age":20}'
curl -XPOST 'localhost:9200/docs/doc/3' -d '{"name":"test 3","age":30}'
curl -XPOST 'localhost:9200/docs/doc/4' -d '{"name":"test 4","age":40}'
curl -XGET 'localhost:9200/_search?pretty' -d '{
"query" : {
"match_all" : {}
},
"filter" : {
@gr0
gr0 / jstack
Created June 29, 2012 13:54
Dump when ElasticSearch CLOSE_WAIT are increasing
This file has been truncated, but you can view the full file.
Deadlock Detection:
Can't print deadlocks:null
Thread 22762: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information may be imprecise)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20, line=196 (Compiled frame)
- java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(java.util.concurrent.SynchronousQueue$TransferStack$SNode, boolean, long) @bci=174, line=424 (Compiled frame)
- java.util.concurrent.SynchronousQueue$TransferStack.transfer(java.lang.Object, boolean, long) @bci=102, line=323 (Compiled frame)
- java.util.concurrent.SynchronousQueue.poll(long, java.util.concurrent.TimeUnit) @bci=11, line=874 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.getTask() @bci=62, line=945 (Compiled frame)