Skip to content

Instantly share code, notes, and snippets.

View merrellb's full-sized avatar

Brian Merrell merrellb

View GitHub Profile
[2011-01-20 03:49:36,519][WARN ][transport.netty ] [Calypso] Exception caught on netty layer [[id: 0x01fb7a3c,
/127.0.0.1:51615 => /127.0.0.1:9300]]
java.io.StreamCorruptedException: invalid data length: -2147418111
at org.elasticsearch.transport.netty.SizeHeaderFrameDecoder.decode(SizeHeaderFrameDecoder.java:42)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:282)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandl
er.java:80)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Defau
@merrellb
merrellb / gist:787646
Created January 20, 2011 09:37
Elastic Search problems with indexing documents with parents using bulk
curl -XPOST localhost:9200/test -d '
{
"mappings" : {
"prediction" : {
"_parent" : {
"type" : "doc"
}
}
}
}
@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"
}
}
}
@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: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"?
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:
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
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: *
@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)
@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":