PHP code example of liquirice / qelastic

1. Go to this page and download the library: Download liquirice/qelastic 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/ */

    

liquirice / qelastic example snippets


"    ...
    "liquirice/qelastic": "~1.0.0"
    ...
},

'providers' => array(
    ...
    Liquirice\Qelastic\QelasticServiceProvider::class,
    ...
)

'aliases' => array(
    ...
    'Qelastic' => 'Liquirice\Qelastic\Facades\Qelastic',
    ...
)

...
ELASTICSEARCH_HOST=127.0.0.1:9200
QUEUE_PATH=App\Jobs\Track\UserBehavior
...

Qelastic::pushToQueue(array(
    'user_id' => '1',
    'action' => 'click',
    'object' => 'event',
    'object_id' => '50786',
    'param' => '{
        "user_name": "admin",
        "email" : "[email protected]"
    }'
))