Skip to content

Commit

Permalink
Tests: use filters over queries
Browse files Browse the repository at this point in the history
Bleedover from cherry-pick frm 0.4.1
  • Loading branch information
dieterve committed Jan 15, 2016
1 parent a9d5524 commit 12d6760
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/Queries/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function testQueryBuildingWithPrefixedIndex()
'type' => 'books',
'body' => [
'query' => [
'bool' => [
'filtered' => [
'filter' => [
['term' => ['year' => 2014]]
]
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/Queries/BooksFrom2014Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace ElasticSearcher\Dummy\Queries;

use ElasticSearcher\Abstracts\AbstractQuery;
use ElasticSearcher\Fragments\Queries\TermQuery;
use ElasticSearcher\Fragments\Filters\TermFilter;

class BooksFrom2014Query extends AbstractQuery
{
public function setup()
{
$this->searchIn('books', 'books');

$this->set('query.bool.filter', [new TermQuery('year', 2014)]);
$this->set('query.filtered.filter', [new TermFilter('year', 2014)]);
}
}

0 comments on commit 12d6760

Please sign in to comment.