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

Added Collapse DSL to QueryBuilder #1724

Merged
merged 5 commits into from
Dec 9, 2019
Merged

Conversation

wackerl91
Copy link
Contributor

That's going to be a bit awkward now: in the PR that added Field Collapsing Support (#1653) I forgot to check in the DSL classes, which made working with it a bit clumsy compared to the usual query methods.
I.e. - as with aggregations - it's now possible to do stuff like this:

$collapse
  ->setFieldname('product_id')
  ->setInnerHits(
    $qb->collapse->inner_hits()  // instead of (new Collapse\InnerHits())
  )

Let me know if there need to be any changes. Cheers :)

CHANGELOG.md Outdated
@@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file based on the
* Launch tests with PHP 7.4
* Added `nullable_type_declaration_for_default_null_value`, `no_alias_functions` CS rules [#1706](https://github.com/ruflin/Elastica/pull/1706)
* Configured `visibility_required` CS rule for constants [#1723](https://github.com/ruflin/Elastica/pull/1723)
* Added `Collapse` DSL to `QueryBuilder`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment, but it would be perfect if you add the link to the PR ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks :)

@@ -2,7 +2,7 @@

namespace Elastica\QueryBuilder\DSL;

use Elastica\Query\InnerHits;
use Elastica\Collapse\InnerHits;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@ruflin ruflin merged commit c3696f8 into ruflin:master Dec 9, 2019
@ruflin
Copy link
Owner

ruflin commented Dec 9, 2019

@wackerl91 Thanks for the contribution and cleanup!

@wackerl91 wackerl91 deleted the dev-collapse_dsl branch December 9, 2019 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants