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

Serial Differencing Aggregation

More info about serial differencing aggregation is in the official elasticsearch docs

Serial differencing is a technique where values in a time series are subtracted from itself at different time lags or periods

Simple example

{
   "aggs": {
      "my_date_histo": {                  
         "date_histogram": {
            "field": "timestamp",
            "interval": "day"
         },
         "aggs": {
            "the_sum": {
               "sum": {
                  "field": "lemmings"     
               }
            },
            "thirtieth_difference": {
               "serial_diff": {                
                  "buckets_path": "the_sum",
                  "lag" : 30
               }
            }
         }
      }
   }
}

And now the query via DSL:

$search = new Search();

$dateAggregation = new DateHistogramAggregation('my_date_histo', 'timestamp', 'day');
$dateAggregation->addAggregation(
    new SumAggregation('the_sum', 'lemmings')
);
$diffAggregation = new SerialDifferencingAggregation('thirtieth_difference', 'the_sum');
$diffAggregation->addParameter('lag', 30);
$dateAggregation->addAggregation($diffAggregation);

$search->addAggregation($dateAggregation);

$aggArray = $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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui