in reply to Re^3: Return value of Search::Elasticsearch search query
in thread Return value of Search::Elasticsearch search query
As per the error I am passing multi types(Hash & JSON). I am changing the ES query into JSON. Due to the error I am trying to pass the hash directly. This is my input doc
{ "sheets": { "sheet1": { "Sheet_Name": "Ex-Sheet", "formulating": [ { "0": { "colName": "Ex-Col1", "formula": "((column08=Submit | column10=Deliv +ered | column09=Something) & (column08=Delivered | column09=Something +))", "total": "false" }, "1": { "colName": "Ex-Col1", "formula": "((column08=Submit | column10=Deliv +ered | column09=Something) & (column08=Delivered | column09=Something +))", "total": "false" }, "2": { "colName": "Ex-Col1", "formula": "(column08=Submit & column10=Delive +red & column09=Something)", "total": "false" } } ] } } }
From this input I am taking the formula field and changing into a ES query (hash). As Athanasius mentioned in the above reply I am replacing the formulae with my hash.
$columns->{$one}{'formula'} = %main_hash; #main_hash contains ES queryBut its replacing as '1/8'. So I passed that as a address
$columns->{$one}{'formula'} = \%main_hash;But now its working only for first element in the loop. For the second element its showing as
[$VAR1->{'request'}{'body'}{'_source'}{'sheets'}{'sheet1'}{'forumle'}[ +0]{'1'}{'formula'}{'query'}{'constant_score'}{'filter'}{'bool'}{'shou +ld'}[0],$VAR1->{'request'}{'body'}{'_source'}{'sheets'}{'sheet1'}{'fo +rumle'}[0]{'1'}{'formula'}{'query'}{'constant_score'}{'filter'}{'bool +'}{'should'}[1],{'....
How to replace my hash in the loop????
if { ..... } else { my %main_hash = (); $main_hash{"query"}{"constant_score"}{"filter"} = @condition_array +[(int($condition)-1)]; my $json = encode_json \%main_hash; print Dumper \%main_hash; #printing very fine he +re $columns->{$one}{'formula'} = \%main_hash; #$columns is a address + in $doc print Dumper $doc; #Working only for firs +t element #exit; #print $json,$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Return value of Search::Elasticsearch search query
by Corion (Patriarch) on Jul 10, 2016 at 07:15 UTC | |
by ravi45722 (Pilgrim) on Jul 10, 2016 at 13:55 UTC | |
by Corion (Patriarch) on Jul 11, 2016 at 07:07 UTC | |
by ravi45722 (Pilgrim) on Jul 13, 2016 at 07:09 UTC |