ravi45722 has asked for the wisdom of the Perl Monks concerning the following question:
I am giving a small snippet of my code. I am pushing elements into the hash in this way.
$main_hash{"query"}{"filtered"}{"query"}{"bool"}{"must"} = \@file_arra +y; $main_hash{"query"}{"filtered"}{"filter"} = $condition_array[(int($con +dition)-1)];
I need the query in the first place. But getting the filter in the first place. How to bind the query in first place???? Expected output (After changing into JSON):
{ "query": { "filtered": { "query": { "bool": { "must": [ {"wildcard": { "path": "/home/GEMS/CDRS/Delivery/ravi_16051820*.log" } } ] } }, "filter": { "bool": { "should": [ { "term": { "OrigInterface": "SMPP" } }, { "term": { "OrigInterface": "SMPP" } } ] } } } } }
Actual output
{ "query": { "filtered": { "filter": { "bool": { "should": [ { "term": { "OrigInterface": "SMPP" } }, { "term": { "OrigInterface": "SMPP" } } ] } }, "query": { "bool": { "must": [ {"wildcard": { "path": "/home/GEMS/CDRS/Delivery/ravi_16051820*.log" } } ] } } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Maintainance of element order in hash
by hippo (Archbishop) on Sep 29, 2016 at 12:50 UTC | |
by ravi45722 (Pilgrim) on Sep 29, 2016 at 13:03 UTC | |
by hippo (Archbishop) on Sep 29, 2016 at 13:43 UTC | |
by ravi45722 (Pilgrim) on Sep 30, 2016 at 02:44 UTC | |
by hippo (Archbishop) on Sep 30, 2016 at 08:33 UTC | |
|
Re: Maintainance of element order in hash
by jellisii2 (Hermit) on Sep 29, 2016 at 13:02 UTC | |
|
Re: Maintainance of element order in hash
by davido (Cardinal) on Sep 30, 2016 at 05:12 UTC |