<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spatie / elasticsearch-search-string-parser example snippets
use Elasticsearch\ClientBuilder;
use Spatie\ElasticsearchStringParser\SearchQuery;
$subjects = SearchQuery::forClient(ClientBuilder::create())
->baseDirective(new SubjectBaseDirective())
->patternDirectives(
new CompanyDirective(),
new UserDirective(),
)
->search('deadly neurotoxin company:aperture @glados');
$searchString = 'cheap neurotoxin company:aperture deadly @glados';
SearchQuery::forClient(ClientBuilder::create())
->baseDirective(new SubjectBaseDirective())
->patternDirectives(
new CompanyDirective(),
new UserDirective(),
)->search($searchString);
$elasticsearch-search-string-parser = new Spatie\ElasticsearchStringParser();
echo $elasticsearch-search-string-parser->echoPhrase('Hello, Spatie!');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.