dev-master
9999999-dev https://github.com/Sandyman/AwsCloudSearchPhpBasic integration AWS CloudSearch API
MIT
The Requires
- php >=5.3.0
by Mark Wilson
amazon aws cloudsearch
Wallogit.com
2017 © Pedro Peláez
Basic integration AWS CloudSearch API
A library to interact with Amazon's AWS CloudSearch API. Please note that this is a fork of Mark Wilson's AwsCloudSearchPhp. You might want to use his library in stead (see Credits)., (*1)
For detailed instructions, check out Making Amazon CloudSearch API Requests., (*2)
curl -s https://getcomposer.org/installer | php php composer.phar install
Require "sandyman/awscloudsearchphp" in your composer.json:-, (*3)
{
"require": {
"sandyman/awscloudsearchphp": "dev-master"
}
}
Pass your CloudSearch domain and server location to initialise the class:, (*4)
$loader = require 'vendor/autoload.php';
$cloudSearch = new \AwsCloudSearch\AwsCloudSearch(<domain>, <server location>);
// search domain's indexed documents
$cloudSearch->setReturnFields(<array of fields in storage>);
$response = $cloudSearch->search(<term>, <additional parameters>);
if ($response->wasSuccessful()) {
print_r($response->getHitDocuments());
}
else {
print_r($response->getErrors());
}
// add/update/delete array of documents
$documents = array();
$document = new \AwsCloudSearch\Document\AddDocument(<id>, <version>, <lang=en>, <fields array>);
$documents[] = $document;
$response = $cloudSearch->processDocuments($documents);
if ($response->wasSuccesful()) {
echo $response;
}
else {
print_r($response->getErrors());
}
You can also check out the samples/ directory., (*5)
Documents must be formatted to the Search Data Format (SDF)., (*6)
If you need help or have questions, please contact Sander Huijsen., (*7)
Forked from AwsCloudSearchPhp., (*8)
Basic integration AWS CloudSearch API
MIT
amazon aws cloudsearch