Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Elasticsearch Dsl Laravel Package

ongr/elasticsearch-dsl

Object-oriented Elasticsearch query builder for PHP. Build searches, filters, aggregations and more with a DSL, then export to arrays for elasticsearch-php or ONGR ElasticsearchBundle. Supports Elasticsearch 5/6/7 via versioned releases.

View on GitHub
Deep Wiki
Context7

Children Aggregation

More info about children aggregation is in the official elasticsearch docs

A special single bucket aggregation that enables aggregating from buckets on parent document types to buckets on child documents.

Simple example

{
    "aggregations": {
        "author_count": {
            "children": {
                "type": "answer"
            },
            "aggregations": {
                "top_names": {
                    "terms": {
                        "field": "owner.display_name"
                    }
                }
            }
        }
    }
}

And now the query via DSL:

$termsAggregation = new TermsAggregation('top_names', 'owner.display_name');

$childrenAggregation = new ChildrenAggregation('author_count', 'answer');
$childrenAggregation->addAggregation($termsAggregation);

$search = new Search();
$search->addAggregation($childrenAggregation);

$queryArray = $search->toArray();
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle