-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filters no longer exist in 2.0. Only queries exist in the DSL.
- Loading branch information
Showing
12 changed files
with
53 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/Fragments/Filters/TermFilter.php → src/Fragments/Queries/TermQuery.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/Fragments/Filters/TermsFilter.php → src/Fragments/Queries/TermsQuery.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use ElasticSearcher\Fragments\Queries\TermQuery; | ||
|
||
class TermQueryTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testBody() | ||
{ | ||
$term = new TermQuery('name', 'elasticsearch'); | ||
|
||
$this->assertEquals(['term' => ['name' => 'elasticsearch']], $term->getBody()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use ElasticSearcher\Fragments\Queries\TermsQuery; | ||
|
||
class TermsQueryTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testBody() | ||
{ | ||
$term = new TermsQuery('name', ['elasticsearch', 'github']); | ||
|
||
$this->assertEquals(['terms' => ['name' => ['elasticsearch', 'github']]], $term->getBody()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?php | ||
|
||
use ElasticSearcher\Abstracts\AbstractQuery; | ||
use ElasticSearcher\Fragments\Filters\TermFilter; | ||
use ElasticSearcher\Fragments\Queries\TermQuery; | ||
|
||
class MoviesFrom2014Query extends AbstractQuery | ||
{ | ||
public function setup() | ||
{ | ||
$this->searchIn('movies', 'movies'); | ||
|
||
$this->set('query.bool.filter', [new TermFilter('year', 2014)]); | ||
$this->set('query.bool.filter', [new TermQuery('year', 2014)]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters