yield 'test filter' =>
[ (new Criteria())->
addFilter(new EqualsFilter('foo', 'bar'
)),
'{"total-count-mode":0,"filter":[{"type":"equals","field":"foo","value":"bar"}]}',
];
yield 'test sorting' =>
[ (new Criteria())->
addSorting(new FieldSorting('foo', 'bar'
)),
'{"total-count-mode":0,"sort":[{"field":"foo","naturalSorting":false,"extensions":[],"order":"bar"}]}',
];
yield 'test term' =>
[ (new Criteria())->
setTerm('foo'
),
'{"total-count-mode":0,"term":"foo"}',
];
yield 'test query' =>
[ (new Criteria())->
addQuery(new ScoreQuery(new EqualsFilter('foo', 'bar'
), 100
)),
'{"total-count-mode":0,"query":[{"score":100.0,"query":{"type":"equals","field":"foo","value":"bar"},"scoreField":null,"extensions":[]}]}',
];
yield 'test aggregation' =>
[ (new Criteria())->
addAggregation(new CountAggregation('foo', 'bar'
)),
'{"total-count-mode":0,"aggregations":[{"name":"foo","type":"count","field":"bar"}]}',
];