Hi,
we use Midgard 1.8.9.1 and need a query to search articles with special
combinations of parameters. We tried the following:
$qb = new midgard_query_builder('midgard_article');
$qb->begin_group('AND');
$qb->begin_group('AND');
$qb->add_constraint('parameter.domain', '=', 'domain1');
$qb->add_constraint('parameter.name', '=', 'name1');
$qb->end_group();
$qb->begin_group('AND');
$qb->add_constraint('parameter.domain', '=', 'domain1');
$qb->add_constraint('parameter.name', '=', 'name2');
$qb->end_group();
$qb->begin_group('AND');
$qb->add_constraint('parameter.domain', '=', 'domain2');
$qb->add_constraint('parameter.name', '=', 'name1');
$qb->end_group();
$qb->end_group();
but got an empty result.
When we use OR for the outer group we get a result. Beside that the
result is not what we really need ("AND") shows the result that every
single constraint-group is correct.
Beside 2nd: When we use OR for the outer group, articles may be multiple
in result - that is unexpected.
Can anyone please give us a hint for getting the correct result. Maybe
query_builder is the wrong tool?
Kind regards
Jan
_______________________________________________
user mailing list
[email protected]
http://lists.midgard-project.org/mailman/listinfo/user