Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
1
Description
Refer to the forum post - https://forums.couchbase.com/t/lcb-err-parsing-failure-208/30523
boolean_query jsonSerialize uses wrong property name for must_not.
The propery named updated by mustNot() is "mustNot", while the property name used to serialize is "must_not".
This results in
Fatal error: Uncaught Couchbase\BaseException: LCB_ERR_PARSING_FAILURE (208)
The following will demonstrate the problem - the serialized bool_query is an empty array.
$interval_query = (new \Couchbase\DateRangeSearchQuery())
->start(0)
->end(0)
->field('deleted_at');
$disjunction_query = new \Couchbase\DisjunctionSearchQuery([$interval_query]);
$bool_query = new \Couchbase\BooleanSearchQuery();
$bool_query->mustNot($disjunction_query);
//var_dump($disjunction_query->jsonSerialize());
var_dump($bool_query->jsonSerialize());