Download the PHP package thelhc/cloud-search-query without Composer
On this page you can find all versions of the php package thelhc/cloud-search-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thelhc/cloud-search-query
More information about thelhc/cloud-search-query
Files in thelhc/cloud-search-query
Package cloud-search-query
Short Description An ORM-like wrapper for building AWS CloudSearch structured queries
License
Informations about the package cloud-search-query
cloud-search-query
An ORM-like wrapper for building AWS CloudSearch structured queries
Installation
CloudSearchQuery is currently a repository package only. In composer.json
add:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/aaronkaz/cloud-search-query.git"
}
],
"require": {
"aaron-kaz/cloud-search-query": "dev-master"
},
Basic Usage
Initialize a query object with a valid CloudSearch full URI endpoint
$query = new CloudSearchQuery([
'endpoint' => 'http://search-yourdomain.us-east-1.cloudsearch.amazonaws.com'
]);
You can chain query methods like so
$query->phrase('ford')
->term('National Equipment', 'seller')
->range('year', '1987');
use the get()
method to submit query and retrieve results from AWS. Use property accessors on the returned results object.
$results = $query->get();
$matchedDocuments = $results->hits;
Search Query Operators and Nested Queries
You can use the and
, or
, and not
operators to build compound and nested queries.
The corresponding and()
, or()
, and not()
methods expect a closure as their argument.
You can chain all available methods as well nest more subqueries inside of closures.
$query->or(function($builder) {
$builder->phrase('ford')
->phrase('truck');
})
All versions of cloud-search-query with dependencies
illuminate/database Version 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.*
illuminate/support Version 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.*
aws/aws-sdk-php Version ^3.19