PHP code example of byng / pimcore-elasticsearch-plugin
1. Go to this page and download the library: Download byng/pimcore-elasticsearch-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/ */
byng / pimcore-elasticsearch-plugin example snippets
use Byng\Pimcore\Elasticsearch\Query\BoolQuery;
use Byng\Pimcore\Elasticsearch\Query\MatchQuery;
use Byng\Pimcore\Elasticsearch\Query\Query;
use Byng\Pimcore\Elasticsearch\Query\QueryBuilder;
use Byng\Pimcore\Elasticsearch\Gateway\PageGateway;
$boolQuery = new BoolQuery();
$boolQuery->addMust(new MatchQuery("_all", "something"));
$query = new Query($boolQuery);
$queryBuilder = new QueryBuilder();
$queryBuilder->setQuery($query);
$queryBuilder->setSize(10); // number of results to return
$pageGateway = PageGateway::getInstance();
$resultSet = $pageGateway->query($queryBuilder);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.