Elasticsearch for json array

So I have an array as such.

[root]# cat testcase.json
[
{
"a": [
"1"
],
"b": [
"2"
]
},
{
"a": [
"3"
],
"b": [
"4"
]
},
{
"a": [
"5"
],
"b": [
"6"
]
}
]

[root]# curl -XPUT 'http://localhost:9200/test/test/1' -d @testcase.json
{"error":"MapperParsingException[Malformed content, must start with an
object]","status":400}

How do i get this working with indexing on elastic search?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Thu, 2013-02-07 at 12:03 -0800, nsharma wrote:

So I have an array as such.

[root]# cat testcase.json
[
{
"a": [
"1"
],
"b": [
"2"
]
},
{
"a": [
"3"
],
"b": [
"4"
]
},
{
"a": [
"5"
],
"b": [
"6"
]
}
]

[root]# curl -XPUT 'http://localhost:9200/test/test/1' -d
@testcase.json
{"error":"MapperParsingException[Malformed content, must start with an
object]","status":400}

How do i get this working with indexing on Elasticsearch?

Wrap it in an object, eg:

{ data: [ { a: [1],....}]}

clint

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.