Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace BoolFilter with BoolQuery where possible #55

Merged
merged 1 commit into from Jan 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Filter/Bool.md
Expand Up @@ -93,4 +93,4 @@ You will get this query:


[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html
[2]: ../Query/Bool.md
[2]: ../Query/Bool.md
2 changes: 1 addition & 1 deletion docs/Filter/index.md
@@ -1,6 +1,6 @@
# Filter

> WARNING: Filters are deprecated since 1.1 and will be removed in 2.0. Elasticsearch from 2.0 casts queries the same way as filters, so there is no reason to have both. More information in [the elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/query-dsl-filters.html)
> __WARNING:__ Filters are deprecated since 1.1 and will be removed in 2.0. Elasticsearch from 2.0 casts queries the same way as filters, so there is no reason to have both. More information in [the elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/query-dsl-filters.html)

Objective filter builder represents all available [Elasticsearch filters][1].

Expand Down
2 changes: 1 addition & 1 deletion docs/HowTo/HowToSearch.md
Expand Up @@ -119,7 +119,7 @@ $missingFilter = new MissingFilter('disabled');
$existsFilter = new ExistsFilter('tag');
$search->addFilter($termFilter);
$search->addFilter($missingFilter);
$search->addFilter($existsFilter, BoolFilter::MUST_NOT);
$search->addFilter($existsFilter, BoolQuery::MUST_NOT);
```

Elasticsearch DSL will form this query:
Expand Down
1 change: 0 additions & 1 deletion src/Aggregation/FilterAggregation.php
Expand Up @@ -13,7 +13,6 @@

use ONGR\ElasticsearchDSL\Aggregation\Type\BucketingTrait;
use ONGR\ElasticsearchDSL\BuilderInterface;
use ONGR\ElasticsearchDSL\Filter\BoolFilter;

/**
* Class representing FilterAggregation.
Expand Down
5 changes: 2 additions & 3 deletions src/Search.php
Expand Up @@ -12,7 +12,6 @@
namespace ONGR\ElasticsearchDSL;

use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
use ONGR\ElasticsearchDSL\Filter\BoolFilter;
use ONGR\ElasticsearchDSL\Highlight\Highlight;
use ONGR\ElasticsearchDSL\Query\BoolQuery;
use ONGR\ElasticsearchDSL\SearchEndpoint\AbstractSearchEndpoint;
Expand Down Expand Up @@ -220,7 +219,7 @@ public function setQueryParameters(array $parameters)
*
* @return $this
*/
public function addFilter(BuilderInterface $filter, $boolType = BoolFilter::MUST, $key = null)
public function addFilter(BuilderInterface $filter, $boolType = BoolQuery::MUST, $key = null)
{
$this->getEndpoint(QueryEndpoint::NAME);
$endpoint = $this->getEndpoint(FilterEndpoint::NAME);
Expand Down Expand Up @@ -267,7 +266,7 @@ public function setFilterParameters(array $parameters)
*
* @return int Key of post filter.
*/
public function addPostFilter(BuilderInterface $filter, $boolType = BoolFilter::MUST, $key = null)
public function addPostFilter(BuilderInterface $filter, $boolType = BoolQuery::MUST, $key = null)
{
$this
->getEndpoint(PostFilterEndpoint::NAME)
Expand Down
1 change: 0 additions & 1 deletion src/SearchEndpoint/AggregationsEndpoint.php
Expand Up @@ -12,7 +12,6 @@
namespace ONGR\ElasticsearchDSL\SearchEndpoint;

use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
use ONGR\ElasticsearchDSL\BuilderBag;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SearchEndpoint/PostFilterEndpoint.php
Expand Up @@ -11,7 +11,6 @@

namespace ONGR\ElasticsearchDSL\SearchEndpoint;

use ONGR\ElasticsearchDSL\Filter\BoolFilter;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand Down
3 changes: 0 additions & 3 deletions src/SearchEndpoint/QueryEndpoint.php
Expand Up @@ -12,12 +12,9 @@
namespace ONGR\ElasticsearchDSL\SearchEndpoint;

use ONGR\ElasticsearchDSL\BuilderInterface;
use ONGR\ElasticsearchDSL\Filter\BoolFilter;
use ONGR\ElasticsearchDSL\ParametersTrait;
use ONGR\ElasticsearchDSL\Query\BoolQuery;
use ONGR\ElasticsearchDSL\Query\FilteredQuery;
use ONGR\ElasticsearchDSL\Serializer\Normalizer\OrderedNormalizerInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SearchEndpoint/SearchEndpointInterface.php
Expand Up @@ -12,7 +12,6 @@
namespace ONGR\ElasticsearchDSL\SearchEndpoint;

use ONGR\ElasticsearchDSL\BuilderInterface;
use ONGR\ElasticsearchDSL\Query\BoolQuery;
use Symfony\Component\Serializer\Normalizer\NormalizableInterface;

/**
Expand Down