function it_returns_the_filtered_query_as_a_json(QueryInterface $query, FilterInterface $filter) { $query->toArray()->willReturn(['field' => 'value']); $filter->toArray()->willReturn(['field' => 'value']); $this->setQuery($query); $this->setFilter($filter); $this->toJson()->shouldReturn(json_encode(['filtered' => ['query' => [['field' => 'value']], 'filter' => [['field' => 'value']]]])); }
function it_returns_the_boosting_query_as_json(QueryInterface $positive, QueryInterface $negative) { $positive->toArray()->willReturn(['field' => 'value']); $negative->toArray()->willReturn(['field' => 'value']); $this->setPositive($positive); $this->setNegative($negative); $this->toJson()->shouldReturn(json_encode(['boosting' => ['positive' => ['field' => 'value'], 'negative' => ['field' => 'value'], 'negative_boost' => 0.2]])); }
function it_return_the_search_json(QueryInterface $search, AggregatesInterface $aggregates) { $search->toArray()->willReturn(['field' => 'value']); $aggregates->toArray()->willReturn(['field' => 'value']); $this->query($search); $this->aggregates($aggregates); $this->searchJson()->shouldReturn(json_encode(['query' => ['field' => 'value'], 'aggs' => ['field' => 'value']])); }
function it_returns_the_bool_query_as_an_array_with_one_options(QueryInterface $queryMustNot) { $queryMustNot->toArray()->willReturn(['field' => 'value']); $this->setMustNot($queryMustNot); $this->toArray()->shouldReturn(['bool' => ['must_not' => [['field' => 'value']]]]); }