Skip to content

Instantly share code, notes, and snippets.

View merrellb's full-sized avatar

Brian Merrell merrellb

View GitHub Profile
@merrellb
merrellb / gist:b31ebeb0e2aefffb6acb
Created October 6, 2014 19:23
Kibana 4 beta error
Timeout::Error - Timeout::Error:
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/protocol.rb:146:in `rbuf_fill'
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/protocol.rb:122:in `readuntil'
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/protocol.rb:132:in `readline'
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:2570:in `read_status_line'
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:2559:in `read_new'
file:/tmp/jruby3542528255876928502extract/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:1327:in `transport_request'
org/jruby/RubyKernel.java:1264:in `catch'
file:/tmp/jruby35
@merrellb
merrellb / gist:1299854
Created October 19, 2011 22:19
All databases gone
[2011-10-19 18:12:52,257][INFO ][node ] [Skull the Slayer] {elasticsearch/0.17.0-SNAPSHOT/2011-07-11T01:41:00}[4894]: initializing ...
[2011-10-19 18:12:52,279][INFO ][plugins ] [Skull the Slayer] loaded [], sites []
[2011-10-19 18:12:55,269][INFO ][node ] [Skull the Slayer] {elasticsearch/0.17.0-SNAPSHOT/2011-07-11T01:41:00}[4894]: initialized
[2011-10-19 18:12:55,269][INFO ][node ] [Skull the Slayer] {elasticsearch/0.17.0-SNAPSHOT/2011-07-11T01:41:00}[4894]: starting ...
[2011-10-19 18:12:55,410][INFO ][transport ] [Skull the Slayer] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.13.134:9300]}
[2011-10-19 18:12:58,466][INFO ][cluster.service ] [Skull the Slayer] new_master [Skull the Slayer][bX6CFuJrTnW_C8H_Mu4VDA][inet[/192.168.13.134:9300]], reason: zen-disco-join (elected_as_master)
[2011-10-19 18:12:58,527][INFO ][discovery ] [Skull the Slayer] elasticsearch/bX
@merrellb
merrellb / gist:957883
Created May 5, 2011 20:42
Deeply nested properties
doc_mapping = {"properties":{"us-patent-grant.us-bibliographic-data-grant.parties.applicants.applicant.addressbook.address.postcode": {"type" : "string", "index" : "analyzed"}}}
or must it be:
doc_mapping = {"properties": {"properties":
{"us-patent-grant.us-bibliographic-data-grant": {"properties":
{"parties": {"properties":
{"applicants": {"properties":
{"applicant": {"properties":
{"addressbook": {"properties":
@merrellb
merrellb / scan exception
Created March 19, 2011 20:32
instead of getting no hits after reaching the end of scan I get the following
Failed to execute phase [fetch], [reduce] ; shardFailures {SearchContextMissingException[No search context found for id [225]]}{SearchContextMissingException[No search context found for id [222]]}{SearchContextMissingException[No search context found for id [223]]}{SearchContextMissingException[No search context found for id [221]]}{SearchContextMissingException[No search context found for id [224]]}]; nested: IndexOutOfBoundsException[index (0) must be less than size (0)
send: 'GET /abcd/doc/8404 HTTP/1.1\r\nHost: 127.0.1.1:9200\r\nAccept-Encoding: identity\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Access-Control-Allow-Origin: *
header: Content-Type: application/json; charset=UTF-8
header: Content-Length: 582
{u'_type': u'doc', u'_id': u'8404', u'_source': {u'sentcc': u'', u'messageuid': u'', u'sentdate': u'', u'groupkey': u'8404', u'sentto': u'', u'msglength': u'', ..... <Truncated>
send: 'GET /abcd/doc/8404?fields=groupkey HTTP/1.1\r\nHost: 127.0.1.1:9200\r\nAccept-Encoding: identity\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Access-Control-Allow-Origin: *
WINDOWS:
Python 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.loads('{"blah":"\\ubaff\\uda00"}')
{u'blah': u'\ubaff\uda00'}
Ubunutu 10.04.2 64-bit
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
I am performing a query that generally works correctly but sometimes get the following:
File "/usr/local/lib/python2.6/dist-packages/pyes-0.15.0-py2.6.egg/pyes/es.py", line 735, in search
return self._query_call("_search", body, indexes, doc_types, **query_params)
File "/usr/local/lib/python2.6/dist-packages/pyes-0.15.0-py2.6.egg/pyes/es.py", line 248, in _query_call
response = self._send_request('GET', path, body, querystring_args)
File "/usr/local/lib/python2.6/dist-packages/pyes-0.15.0-py2.6.egg/pyes/es.py", line 218, in _send_request
raise pyes.exceptions.ElasticSearchException(response.body, response.status, response.body)
Contrary to the comments in this section of es.py the request looks successful however removing the exception handling reveals an underlying json error:
@merrellb
merrellb / gist:841428
Created February 23, 2011 23:31
Empty strings in facets.
{"query": {"match_all": {}}, "facets": {"family": {"terms": {"field": "family", "size": 1000000}}}, "fields": []}
in the response I get back a massive list of term facets, one of which is {u'count': 242, u'term': u''} in a addition to a "missing" field with the number 4604 (which matches up with the number returned when executing a missing query on the same field)
My questions are:
1) Why does empty-string appear as a facet if it is synonymous with missing?
2) Are the 242 empty-string facets included in the 4604 "missing"?
@merrellb
merrellb / gist:841300
Created February 23, 2011 22:07
Error when trying to startup
./elasticsearch
merrellb@SC440:/tank/active/ES/elasticsearch/bin$ Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/bootstrap/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.elasticsearch.bootstrap.Bootstrap. Program will exit.
@merrellb
merrellb / gist:787668
Created January 20, 2011 09:51
Problems with bulk inserts and parent mappings
curl -XDELETE 'http://localhost:9200/test'
curl -XPOST localhost:9200/test -d '
{
"mappings" : {
"docval" : {
"_parent" : {
"type" : "doc"
}
}
}