Project Description:

Offers an implementation of a Search API server that uses an Amazon AWS CloudSearch domain for indexing and searching content.

Project page:

http://drupal.org/sandbox/welshtzigane/1587596

git clone --recursive --branch 7.x-1.x welshtzigane@git.drupal.org:sandbox/welshtzigane/1587596.git

This project is only compatible with Drupal 7 as it ties in directly with Search API (which is D7 only).

Features

  • Supports Facets
  • Supports Views integration
  • Supports Search pages
  • Allows multiple search domains across multiple AWS accounts
  • Supports sorting

See screenshot

Notes on testing

To test this module an AWS account is required. This may make it a bit tricky as there is a cost associated with running a CloudSearch. If you want to use my Account please let me know and I can set you up with some limited credentials.


Update: There is a 30 day trial available: http://aws.amazon.com/cloudsearch/free-trial/

More information

Specifically, this module implements the SearchApiAbstractService Search API class. This provides the option in Search API to add a server of type CloudSearch and implements the methods to add/remove indexes, fields and items.
This will require a valid AWS API access key and secret key of an AWS account. The module will create a CloudSearch domain or use an existing one.

Requirements

In order to setup a CloudSearch index AWS SDK for PHP needs to be installed and setup. Specifically the AWSSDKforPHP library needs to be downloaded and placed in the libraries folder. Easiest way to do this is to clone from github into /sites/all/libraries/

git clone git://github.com/amazonwebservices/aws-sdk-for-php.git awssdk

Note that the CloudSearch module does not make use of the credentials only the library as it will support multiple accounts.

Comments

klausi’s picture

Welcome,

please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxwelshtzigane1587596git

welshtzigane’s picture

Thanks, will do. I've corrected the README.txt issue so should be OK now.
http://ventral.org/pareview/httpgitdrupalorgsandboxwelshtzigane1587596git

brycefisherfleig’s picture

Status: Needs review » Needs work

Hi welshtzigane,

Ambitious project! It sounds really cool, and you've got an active issue queue already demanding this module. Impressive. Great job fixing the automated review issues. Also, I love the vertical tabs on the admin page, and wildcard hook_menu item! Well done.

I'm not seeing any similar modules that do CloudSearch, though there are a LOT of Amazon modules out there and I don't know anything about Amazon's offerings. Even in sandbox, your module came up often in my module searches through d.o.

Project Page Description As a total nube on AWS, I don't understand what this would let me search/index. Would this module allow AWS to search my own site? Or would this connect my drupal install to Amazon cloud data? Please add a little more information or a link to more information on your project page.

Project Page / README Completeness The project page and README.txt or INSTALLL.txt should explain that facetapi, ctools, libraries, and entity are also required projects. You can literally copy and paste this information from one place to another, but it should probably be in the README.txt or INSTALL.txt.

Git Instructions Also, the git clone information above isn't right. You may want to update the git clone instructions for future reviewers. It should be:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/welshtzigane/1587596.git search_api_amazon_cloudsearch
cd search_api_amazon_cloudsearch

service.inc, line 22 Overall, the code is very elegant. However this line (and others in the same file such as 23, 64, 70, 77, 94, etc) are too long. Also, these same lines can make better use of t() with links. As described in the api docs for l():

However, for links enclosed in translatable text you should use t() and embed the HTML anchor tag directly in the translated string. For example:

t('Visit the <a href="@url">settings</a> page', array('@url' => url('admin')));

This keeps the context of the link title ('settings' in the example) for translators.

You should use line breaks in the array()s you would add, thus improving code readability. Also, passing the values through t() escapes the the variables, increasing security at the same time :-)

service.inc, line 106 Although curl is often installed and easy to install, you might want to note in README.txt (and/or on the project page?) that cURL is required for this module.

service.inc, line 173-175 Coding Standards on comments encourage inline comments even for multiple lines. Please these lines change to:

// This isn't a new domain so check it actually exists and
// raise an error if not.

service.inc, lines 215-217 change to inline. Also happens in the AWS*.inc code. You can probably search and replace /*\r with // throughout the project.

search_api_amazon_cloudsearch.admin.inc, lines 43 - 52 could you add a short inline comment explain what's happening here a little bit more? I don't quite get it, but I'm sure it's right. Thanks!

AWSCloudSearchDomain.inc, line58 I'm seeing t('...') . $var . t('...'). Please rewrite as t('... @var ...', array('@var' => $var));. Passing these variables through t()'s second parameter will escape them properly, thus improving the security of your module.

AWSCloudSearchDomain.inc, line 157 & 168 move the closing parentheses to new lines.

Overall, I have to say you're a better programmer than me, and I've learned about several drupal APIs from reading through your code that I was unaware of. Mostly, I've uncovered stylistic issues, however I don't fully understand security risks are present in AWSSDK or what all is going on with that code. With the exception of your use of t(), your coding is nearly impeccable. I hope your project is accepted soon!

brycefisherfleig’s picture

Oh man...just after posting this, I found another possibly similar module: http://drupal.org/project/restws_search_api. I don't see it mention Amazon CloudSearch though. How different is that module from what you are providing? Thanks for answering my silly question!

welshtzigane’s picture

Thank you very much for your very detailed feedback! I will go through it properly this weekend. Luckily it's not the same as RestWS Search API as this is another type of plugin into the Search API module.

Again thank you for this feedback, appreciate it.

brycefisherfleig’s picture

No problem! It was a pleasure to look through your code. Thanks for clarifying that your module is different.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Making reviewers aware there is a 30 day trial of CloudSearch available.