logs:
[2010-10-05 20:59:10,094][DEBUG][action.index ]
[Abominatrix] [index][1], node[7cfee996-5fc0-4048-8137-b812ac0c7c5f],
[P], s[STARTED]: Failed to execute [index {[index][type][821ce2ad-
e20f-4d59-ba77-f75c820dd94e], source[? execute ]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive
xcontent from [-128, 1, 0, 1, 0, 0, 0, 7, 101, 120, 101, 99, 117, 116,
101, 0, 0, 0, 0, 12, 0, 1, 8, 0, 1, 0, 0, 0, 2, 11, 0, 2, 0, 0, 0, 11,
47, 105, 110, 100, 101, 120, 47, 116, 121, 112, 101, 13, 0, 3, 11, 11,
0, 0, 0, 1, 0, 0, 0, 6, 112, 114, 101, 116, 116, 121, 0, 0, 0, 4, 116,
114, 117, 101, 13, 0, 4, 11, 11, 0, 0, 0, 1, 0, 0, 0, 12, 67, 111,
110, 116, 101, 110, 116, 45, 84, 121, 112, 101, 0, 0, 0, 16, 97, 112,
112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 120, 115, 111, 110, 11,
0, 5, 0, 0, 0, 17, 123, 34, 110, 97, 109, 101, 34, 58, 32, 34, 118,
97, 108, 117, 101, 34, 125, 0, 0]
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
132)
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
123)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
321)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
308)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:
208)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
140)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
62)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
385)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$400(TransportShardReplicationOperationAction.java:212)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:282)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[2010-10-05 20:59:59,384][DEBUG][action.index ]
[Abominatrix] [index][0], node[7cfee996-5fc0-4048-8137-b812ac0c7c5f],
[P], s[STARTED]: Failed to execute [index {[index][type]
[1b080d59-7b60-4b98-97ba-e1b9b492a5e9], source[? execute ]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive
xcontent from [-128, 1, 0, 1, 0, 0, 0, 7, 101, 120, 101, 99, 117, 116,
101, 0, 0, 0, 0, 12, 0, 1, 8, 0, 1, 0, 0, 0, 2, 11, 0, 2, 0, 0, 0, 11,
47, 105, 110, 100, 101, 120, 47, 116, 121, 112, 101, 13, 0, 3, 11, 11,
0, 0, 0, 1, 0, 0, 0, 6, 112, 114, 101, 116, 116, 121, 0, 0, 0, 4, 116,
114, 117, 101, 13, 0, 4, 11, 11, 0, 0, 0, 1, 0, 0, 0, 12, 67, 111,
110, 116, 101, 110, 116, 45, 84, 121, 112, 101, 0, 0, 0, 16, 97, 112,
112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 120, 115, 111, 110, 11,
0, 5, 0, 0, 0, 17, 123, 34, 110, 97, 109, 101, 34, 58, 32, 34, 118,
97, 108, 117, 101, 34, 125, 0, 0]
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
132)
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
123)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
321)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
308)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:
208)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
140)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
62)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
385)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$400(TransportShardReplicationOperationAction.java:212)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:282)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[2010-10-05 21:01:10,418][DEBUG][action.index ]
[Abominatrix] [index][3], node[7cfee996-5fc0-4048-8137-b812ac0c7c5f],
[P], s[STARTED]: Failed to execute [index {[index][type]
[2627f2c1-9c79-4727-8154-99895d8933d2], source[? execute ]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive
xcontent from [-128, 1, 0, 1, 0, 0, 0, 7, 101, 120, 101, 99, 117, 116,
101, 0, 0, 0, 0, 12, 0, 1, 8, 0, 1, 0, 0, 0, 2, 11, 0, 2, 0, 0, 0, 11,
47, 105, 110, 100, 101, 120, 47, 116, 121, 112, 101, 13, 0, 3, 11, 11,
0, 0, 0, 1, 0, 0, 0, 6, 112, 114, 101, 116, 116, 121, 0, 0, 0, 4, 116,
114, 117, 101, 13, 0, 4, 11, 11, 0, 0, 0, 1, 0, 0, 0, 12, 67, 111,
110, 116, 101, 110, 116, 45, 84, 121, 112, 101, 0, 0, 0, 16, 97, 112,
112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 11,
0, 5, 0, 0, 0, 17, 123, 34, 110, 97, 109, 101, 34, 58, 32, 34, 118,
97, 108, 117, 101, 34, 125, 0, 0]
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
132)
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
123)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
321)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
308)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:
208)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
140)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
62)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
385)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$400(TransportShardReplicationOperationAction.java:212)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:282)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[2010-10-05 21:01:33,458][DEBUG][action.index ]
[Abominatrix] [index][3], node[7cfee996-5fc0-4048-8137-b812ac0c7c5f],
[P], s[STARTED]: Failed to execute [index {[index][type][9317b3d8-
ecdf-464c-840a-c6cfbc7e0c87], source[? execute ]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive
xcontent from [-128, 1, 0, 1, 0, 0, 0, 7, 101, 120, 101, 99, 117, 116,
101, 0, 0, 0, 0, 12, 0, 1, 8, 0, 1, 0, 0, 0, 2, 11, 0, 2, 0, 0, 0, 11,
47, 105, 110, 100, 101, 120, 47, 116, 121, 112, 101, 13, 0, 3, 11, 11,
0, 0, 0, 1, 0, 0, 0, 6, 112, 114, 101, 116, 116, 121, 0, 0, 0, 4, 116,
114, 117, 101, 13, 0, 4, 11, 11, 0, 0, 0, 1, 0, 0, 0, 12, 67, 111,
110, 116, 101, 110, 116, 45, 84, 121, 112, 101, 0, 0, 0, 16, 97, 112,
112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 11,
0, 5, 0, 0, 0, 17, 123, 34, 110, 97, 109, 101, 34, 58, 32, 34, 118,
97, 108, 117, 101, 34, 125, 0, 0]
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
132)
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:
123)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
321)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:
308)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:
208)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
140)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
62)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
385)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$400(TransportShardReplicationOperationAction.java:212)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:282)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
On 10月5日, 下午8时48分, Medcl me...@163.com wrote:
yes,and here is the code:
TSocket tsocket=new TSocket("localhost",9500);
var transport = new TFramedTransport(tsocket);
var protocol = new TBinaryProtocol(transport);
var client = new Rest.Client(protocol);
transport.Open();
var restRequest = new RestRequest();
restRequest.Method = Method.POST;
restRequest.Uri = "/index/type";
restRequest.Body=System.Text.UTF8Encoding.UTF8.GetBytes("{"name":
"value"}");
restRequest.Parameters=new Dictionary<string,
string>();
restRequest.Parameters.Add("pretty", "true");
var response= client.execute(restRequest);
var str=
System.Text.UTF8Encoding.Default.GetString(response.Body);
On 10月5日, 下午8时30分, Shay Banon shay.ba...@elasticsearch.com wrote:
Are you indexing a json? do you convert the json string into UTF8 byte
array?
2010/10/5 Medcl me...@163.com
hey,shay.banon ,i am using thrift in .net,and the type of request's
body and response's body is byte array,Method with Get is fine,and
the post method returned the following error,and i am a little
confused aboutxcontentand smile, i think i should use the right type
to serialize request.body or deserialize the response.body,so what
can i do?:
[2010-10-05 20:05:39,999][DEBUG][action.index ]
[Abominatrix] [index
][2], node[7cfee996-5fc0-4048-8137-b812ac0c7c5f], [P], s[STARTED]:
Failed to exe
cute [index {[index][type][bc40f94b-aba4-43c8-a7d3-26517140ccd0],
source[?
1, 34, 125, 0, 0]
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFa
ctory.java:132)
at
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFa
ctory.java:123)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(
XContentDocumentMapper.java:321)
at
org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(
XContentDocumentMapper.java:308)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreat
e(InternalIndexShard.java:208)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnP
rimary(TransportIndexAction.java:140)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnP
rimary(TransportIndexAction.java:62)
at
org.elasticsearch.action.support.replication.TransportShardReplicatio
nOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplic
ationOperationAction.java:385)
at
org.elasticsearch.action.support.replication.TransportShardReplicatio
nOperationAction$AsyncShardOperationAction.access
$400(TransportShardReplicationO
perationAction.java:212)
at
org.elasticsearch.action.support.replication.TransportShardReplicatio
nOperationAction$AsyncShardOperationAction
$1.run(TransportShardReplicationOperat
ionAction.java:282)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
On 9月15日, 下午7时00分, Shay Banon shay.ba...@elasticsearch.com wrote:
Hi,
elasticsearch has support a binary format similar to json for
some
time
now, named "xson". This was used internally when using the Java API
when
possible (for example, a search request used it automatically). The
good
news is that the good people at Jackson (actually Tatu) has created
an
excellent binary format for JSON called Smile. I have already
pushed
support
for that, moreover, I have removed XSON completely and now use
Smile as
the
formal binary format for JSON.
Another good news is that the Smile format is public and
properly
documented. You can find it here:
http://wiki.fasterxml.com/JacksonBinaryFormat, with the format here:
http://wiki.fasterxml.com/JacksonBinaryFormatSpec. I must say that
this is
one of the best binary formats I have seen for JSON (BSON is an
abomination). It is a bit complicated in some places (zigzagging
numbers,
and so on), but well worth the effort.
I am posting it here since if someone from other lang camps here
can
maybe take it and implement it in the respective language. I am
trying to
work with Tatu to get a proper web site to it and to make it feel
more
formal. This should be the formal binary representation of JSON.
As far as elasticsearch, it plays with both easily, on all
layers
(including REST). Moreover, you can push data in one format and get
it in
another format easily (for example, JSON for debugging, but Smile
as the
default). With the REST layer, you don't have to provide content
type, as
its detected automatically based on the body, or you can simply
sent a
content type of application/smile for API level, source level
format is
automatically detected. Also, the response is automatically send
using
the
format of the request.
On the Java end, there has been some refacoring which should not
affect
most users. If you were using the XContentBuilder base class, then
nothing
changes. The BinaryXContentBuilder and StringXContentBuilder were
removed
and now we only have XContentBuilder. The XSON format has basically
been
renamed to Smile format.
As a side note, elasticsearch has an abstraction on top of its
both
parsing and building of "xcontent", so, for example, support other
fomrats
(like XML) should not be too difficult to add. Are you interested
in it?
-shay.banon