You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this method says toArray() but nevertheless it can generate a payload which still isn't suitable for ES because it would require a new stdClass instead of an empty array.
This results in: ... nested: QueryParsingException[[test] No query registered for [not]]; }]
When however using {} for bool the query executes fine.
Here's a more "PHP only" example:
$body = new \Elastica\Query();
$body->setQuery(
new \Elastica\Query\Filtered(
new \Elastica\Query\Bool(),
(new \Elastica\Filter\Bool())
->addShould(
new \Elastica\Filter\BoolNot(
new \Elastica\Filter\Missing('whatever'))
)
)
);
echojson_encode($body->toArray(), JSON_PRETTY_PRINT);
I know this method says
toArray()
but nevertheless it can generate a payload which still isn't suitable for ES because it would require anew stdClass
instead of an empty array.The code
generates
and json encoded for ES this gets
It seems this is problematic in certain cases and
bool
should be an empty object and not array.Here's an example I discovered this (example from Sense):
This results in:
... nested: QueryParsingException[[test] No query registered for [not]]; }]
When however using
{}
forbool
the query executes fine.Here's a more "PHP only" example:
Results in:
Sending this to ES will generate the aforementioned error message.
The text was updated successfully, but these errors were encountered: