Help in query


(surfer) #1

Hi,

I'm indexing something like:

first doc = { "v4" : "myvalue" }
second doc = { "v1" : [ { "v4" : "myvalue" }, { "v5" : "anothervalue" } ] }
third doc = { "v1" : [ { "v2" : [ {"v4" : "myvalue" }] } ] }
fourth doc = { "v1" : [ { "v2" : [ { "v3" : [ { "v4" : "myvalue" }] }
] } ] }

so nested dictionaries and array of dictionaries.

I was wondering if there is a query to obtain all the docs that have
"v4" : "myvalue" and another condition that has to be satisfied is that
this must happen inside a "v1" dictionary and whatever number of
intermediate dictionaries (none, v2, v2 and v3) that is with the three
docs written my query should give:

second doc, third doc and fourth doc

Any hint is appreciated
giovanni

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/53B2E682.40700%40crs4.it.
For more options, visit https://groups.google.com/d/optout.


(vineeth mohan-2) #2

Hello Giovanni ,

I feel this will help -
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_literal_multi_match_literal_query_2.html#_wildcards_in_field_names

Thanks
Vineeth

On Tue, Jul 1, 2014 at 10:19 PM, surfer surfer@crs4.it wrote:

Hi,

I'm indexing something like:

first doc = { "v4" : "myvalue" }
second doc = { "v1" : [ { "v4" : "myvalue" }, { "v5" : "anothervalue" } ] }
third doc = { "v1" : [ { "v2" : [ {"v4" : "myvalue" }] } ] }
fourth doc = { "v1" : [ { "v2" : [ { "v3" : [ { "v4" : "myvalue" }] }
] } ] }

so nested dictionaries and array of dictionaries.

I was wondering if there is a query to obtain all the docs that have
"v4" : "myvalue" and another condition that has to be satisfied is that
this must happen inside a "v1" dictionary and whatever number of
intermediate dictionaries (none, v2, v2 and v3) that is with the three
docs written my query should give:

second doc, third doc and fourth doc

Any hint is appreciated
giovanni

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53B2E682.40700%40crs4.it.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D1MiPxmqSUFaxZg7%3DsiUaUQPSkn_XWUfycz%2BqmXpEJbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(surfer) #3

That definitely helped it. Thank you Vineeth
Regards
giovanni

On 07/01/2014 07:19 PM, vineeth mohan wrote:

Hello Giovanni ,

I feel this will help

Thanks
Vineeth

On Tue, Jul 1, 2014 at 10:19 PM, surfer <surfer@crs4.it
mailto:surfer@crs4.it> wrote:

Hi,

I'm indexing something like:

first doc    =   { "v4" : "myvalue" }
second doc = { "v1" : [ { "v4" : "myvalue" }, { "v5" :
"anothervalue" } ] }
third doc    =  { "v1" : [ { "v2" : [ {"v4" : "myvalue" }] } ] }
fourth doc  =  { "v1" :  [ { "v2" : [ { "v3" : [ { "v4" :
"myvalue" }] }
] } ] }

so nested dictionaries and array of dictionaries.

I was wondering if there is a query to obtain all the docs that have
"v4" : "myvalue" and another condition that has to be satisfied is
that
this must happen inside a "v1" dictionary and whatever number of
intermediate dictionaries (none, v2, v2 and v3)  that is with the
three
docs written my query should give:

second doc, third doc and fourth doc

Any hint is appreciated
giovanni

--
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
<mailto:elasticsearch%2Bunsubscribe@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53B2E682.40700%40crs4.it.
For more options, visit https://groups.google.com/d/optout.

--
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
mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D1MiPxmqSUFaxZg7%3DsiUaUQPSkn_XWUfycz%2BqmXpEJbQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D1MiPxmqSUFaxZg7%3DsiUaUQPSkn_XWUfycz%2BqmXpEJbQ%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/53B3B3BE.3060307%40crs4.it.
For more options, visit https://groups.google.com/d/optout.


(surfer) #4

oops there is an "it" that doesn't belong....
On 07/02/2014 09:24 AM, surfer wrote:

That definitely helped it. Thank you Vineeth
Regards
giovanni

On 07/01/2014 07:19 PM, vineeth mohan wrote:

Hello Giovanni ,

I feel this will help

Thanks
Vineeth

On Tue, Jul 1, 2014 at 10:19 PM, surfer <surfer@crs4.it
mailto:surfer@crs4.it> wrote:

Hi,

I'm indexing something like:

first doc    =   { "v4" : "myvalue" }
second doc = { "v1" : [ { "v4" : "myvalue" }, { "v5" :
"anothervalue" } ] }
third doc    =  { "v1" : [ { "v2" : [ {"v4" : "myvalue" }] } ] }
fourth doc  =  { "v1" :  [ { "v2" : [ { "v3" : [ { "v4" :
"myvalue" }] }
] } ] }

so nested dictionaries and array of dictionaries.

I was wondering if there is a query to obtain all the docs that have
"v4" : "myvalue" and another condition that has to be satisfied
is that
this must happen inside a "v1" dictionary and whatever number of
intermediate dictionaries (none, v2, v2 and v3)  that is with the
three
docs written my query should give:

second doc, third doc and fourth doc

Any hint is appreciated
giovanni

--
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
<mailto:elasticsearch%2Bunsubscribe@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53B2E682.40700%40crs4.it.
For more options, visit https://groups.google.com/d/optout.

--
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
mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D1MiPxmqSUFaxZg7%3DsiUaUQPSkn_XWUfycz%2BqmXpEJbQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3D1MiPxmqSUFaxZg7%3DsiUaUQPSkn_XWUfycz%2BqmXpEJbQ%40mail.gmail.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

--
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
mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53B3B3BE.3060307%40crs4.it
https://groups.google.com/d/msgid/elasticsearch/53B3B3BE.3060307%40crs4.it?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/53B3B462.5060405%40crs4.it.
For more options, visit https://groups.google.com/d/optout.


(system) #5