ElasticSearch Head and nested JSON

I have a question on how to use ES-Head with nested JSON documents. The
problem appears to be when the nested document re-uses field names.

Here is my sample document
{
"a": {
"b": {
"c":"firstval",
"b":"secondval"
},
"d": {
"b":"thirdval"
}
}
}

I can successfully query this document using curl as follows:
curl -XGET 'localhost:9200/twitter/_search?q=tweet.a.b.b=secondval'
curl -XGET 'localhost:9200/twitter/_search?q=tweet.a.d.b=thirdval'

However, I cannot get this to work for both cases in ES-Head.

In the Browser tab, I see the one document

_index
_type
_id

_score
c
b
twittertweet11firstvalthirdval

Under Fields (on the left), I can only search for the a.b.b field. It
doesn't appear to allow me to search on the a.d.b field.

Under the Structured Query tab I can select either the a.b.b field or the
a.d.b field. However, the search does not succeed for the the a.d.b field.

The problem is apparently due to the repeated use of the same field name.
If I modify the document and rename the field a.d.b to a.d.somethingelse,
then the queries work fine.

This isn't just an academic exercise. My documents have numerous duplicate
field names and it would be inconvenient to replace them with unique names.

ES-Head is an excellent tool. Thank you.

--
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.

Hi,

Please see issues tracking this problem on github for more info

field names not qualified · Issue #36 · mobz/elasticsearch-head · GitHub (fixed) and
Column headers on browser should be path not field_name · Issue #45 · mobz/elasticsearch-head · GitHub (not fixed)

Essentially, it's a design flaw dating from the earlier days of the
project. I've fixed it on Structured Query, but it's a bit more tricky on
the browser. There is a partial solution described on github. ymmv

-B

On Thursday, 21 February 2013 09:42:01 UTC+11, Cayman wrote:

I have a question on how to use ES-Head with nested JSON documents. The
problem appears to be when the nested document re-uses field names.

Here is my sample document
{
"a": {
"b": {
"c":"firstval",
"b":"secondval"
},
"d": {
"b":"thirdval"
}
}
}

I can successfully query this document using curl as follows:
curl -XGET 'localhost:9200/twitter/_search?q=tweet.a.b.b=secondval'
curl -XGET 'localhost:9200/twitter/_search?q=tweet.a.d.b=thirdval'

However, I cannot get this to work for both cases in ES-Head.

In the Browser tab, I see the one document

_index
_type
_id

_score
c
b
twittertweet11firstvalthirdval

Under Fields (on the left), I can only search for the a.b.b field. It
doesn't appear to allow me to search on the a.d.b field.

Under the Structured Query tab I can select either the a.b.b field or the
a.d.b field. However, the search does not succeed for the the a.d.b field.

The problem is apparently due to the repeated use of the same field name.
If I modify the document and rename the field a.d.b to a.d.somethingelse,
then the queries work fine.

This isn't just an academic exercise. My documents have numerous
duplicate field names and it would be inconvenient to replace them with
unique names.

ES-Head is an excellent tool. Thank you.

--
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.