New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

thelhc/cloud-search-query

An ORM-like wrapper for building AWS CloudSearch structured queries
11,943 3
Install
composer require thelhc/cloud-search-query
Latest Version:v2.4.1
PHP:~5.6|~7.0|~7.1|~7.2|~7.3
Laravel:5
Last Updated:Jan 20, 2020
Links: GitHub  ·  Packagist
Maintainer: thelhc

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');
        })

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

665,354,487 9,703
laravel/framework

The Laravel Framework.

633,434,998 35,124
laravel/tinker

Powerful REPL for the Laravel framework.

539,265,140 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

458,029,405 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662

Version History

Version Released PHP Laravel License
v2.4.1 ~5.6|~7.0|~7.1|~7.2|~7.3 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.*
v2.4.0 ~5.6|~7.0|~7.1|~7.2|~7.3 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*
v2.3.1 ~5.6|~7.0|~7.1|~7.2|~7.3 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*
v2.3.0 ~5.6|~7.0|~7.1 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*
v2.2.8 ~5.6|~7.0|~7.1 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.* || 5.7.*