PHP code example of marcelsud / elastic-search-plugin

1. Go to this page and download the library: Download marcelsud/elastic-search-plugin 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/ */

    

marcelsud / elastic-search-plugin example snippets


     new \ONGR\ElasticsearchBundle\ONGRElasticsearchBundle(),
     new \SimpleBus\SymfonyBridge\SimpleBusCommandBusBundle(),
     new \SimpleBus\SymfonyBridge\SimpleBusEventBusBundle(),
     new \ONGR\FilterManagerBundle\ONGRFilterManagerBundle(),
     new \Sylius\ElasticSearchPlugin\SyliusElasticSearchPlugin(),
    

$this->client->request('GET', '/shop-api/products', ['attributes' => ['Mug material' => ['Wood']]], [], ['ACCEPT' => 'application/json']);

$this->client->request('GET', '/shop-api/products', ['attributes' => ['Mug material' => ['Wood']], 'locale' => 'en_GB'], [], ['ACCEPT' => 'application/json']);

    /shop-api/taxon-products/mugs?channel=WEB_DE&price=2000;3000

    /shop-api/taxon-products/mugs?channel=WEB_GB