PHP code example of pskordilakis / elastin

1. Go to this page and download the library: Download pskordilakis/elastin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pskordilakis / elastin example snippets

 php
$builder->index('index_1')
 php
$builder->indices(['index_2', 'index_3']);
 php
$builder->filter('term', [ 'tag' => 'search' ]);
 php
$builder->aggregation('aggregation_name', [ 'aggregation_type' => $aggregation_body ]);
 php
$query = $builder->build();

$client->search($query);
 php
$builder->where($field, $value);
 php
$builder->whereBetween($field, $gte, $lte);
 php
$builder->count($name, $field);
 php
$builder->cardinality($name, $field);
 php
$builder->groupBy($name, $field);
 php
$builder->timeSeries($name, $field, $options);