add variable `$parent` on make ES query #90
This commit is contained in:
parent
64399da8ac
commit
de7391a3a4
|
@ -434,7 +434,7 @@ class Elastic_Press {
|
||||||
//"size" => $filter['max_options'],
|
//"size" => $filter['max_options'],
|
||||||
"script" => [
|
"script" => [
|
||||||
"lang" => "painless",
|
"lang" => "painless",
|
||||||
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == 0) { return doc['$field.term_id'][i]; }}",
|
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == $parent) { return doc['$field.term_id'][i]; }}",
|
||||||
//"source"=> "def c= [''];if(!params._source.terms.empty && params._source.$field != null){ for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
//"source"=> "def c= [''];if(!params._source.terms.empty && params._source.$field != null){ for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -561,7 +561,7 @@ class Elastic_Press {
|
||||||
"terms" => [
|
"terms" => [
|
||||||
"script" => [
|
"script" => [
|
||||||
"lang" => "painless",
|
"lang" => "painless",
|
||||||
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == 0) { return doc['$field.term_id'][i]; }}",
|
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == $parent) { return doc['$field.term_id'][i]; }}",
|
||||||
//"source" => "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
//"source" => "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
@ -578,7 +578,7 @@ class Elastic_Press {
|
||||||
"terms" => array(
|
"terms" => array(
|
||||||
"script" => [
|
"script" => [
|
||||||
"lang" => "painless",
|
"lang" => "painless",
|
||||||
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == 0) { return doc['$field.term_id'][i]; }}",
|
"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == $parent) { return doc['$field.term_id'][i]; }}",
|
||||||
//"source"=> "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
//"source"=> "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue