2017 © Pedro Peláez
 

library awscloudsearchphp

Basic integration AWS CloudSearch API

image

raptor404/awscloudsearchphp

Basic integration AWS CloudSearch API

  • Friday, August 8, 2014
  • by raptor404
  • Repository
  • 1 Watchers
  • 0 Stars
  • 655 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 2 Versions
  • 18 % Grown

The README.md

AwsCloudSearch PHP API Wrapper

A library to interact with Amazon's AWS CloudSearch API. Please note that this is a fork of Sander Huijsen's fork of Mark Wilson's AwsCloudSearchPhp. You might want to use one of their libraries in stead (see Credits)., (*1)

Requirements

  • PHP 5+
  • cURL extension
  • AWS account
  • CloudSearch domain

Getting Started

For detailed instructions, check out Making Amazon CloudSearch API Requests., (*2)

curl -s https://getcomposer.org/installer | php
php composer.phar install

Require "raptor404/awscloudsearchphp" in your composer.json:-, (*3)

{
    "require": {
        "raptor404/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)

Credits

Forked from AwsCloudSearchPhp which is a for of AwsCloudSearchPhp., (*7)

The Versions

08/08 2014

dev-master

9999999-dev https://github.com/raptor404/AwsCloudSearchPhp

Basic integration AWS CloudSearch API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

amazon aws cloudsearch

31/07 2014

0.0.1

0.0.1.0 https://github.com/Sandyman/AwsCloudSearchPhp

Basic integration AWS CloudSearch API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

amazon aws cloudsearch