Amazon Cloudsearch - Environment Variables, Errors and Settings

For a recent project we had to improve the current search functionality and results for an eCommerce store. After considering the various options available that were within the budget and the limited time available to implement the chosen solutions we settled on Amazon Cloudsearch. We ran into a couple of errors with the command line […]

For a recent project we had to improve the current search functionality and results for an eCommerce store. After considering the various options available that were within the budget and the limited time available to implement the chosen solutions we settled on Amazon Cloudsearch.

We ran into a couple of errors with the command line tool that Amazon provides.

Error:

Right now I Cannot remember the exact error messages,  but will try find it and update this post.

We found that specifying the variables under System -> Environment Variables did not always work so we resorted to using the set method in cmd however these variables are not saved between sessions so our solution was to create a setting.bat file  that was run at the start of each new cmd session, the file contained the following:

set JAVA_HOME=”C:\Program Files (x86)\Java\jre7″
set CS_HOME=”C:\path\to\files”
set PATH=%PATH%;%CS_HOME%\bin
set CS_ENDPOINT=cloudsearch.us-west-2.amazonaws.com
set AWS_CREDENTIAL_FILE=”C:\path\to\files\aws.txt”

 

Error:

Of a total of X source file(s), failed to wholly/partially process X file(s) 
Java.lang.IllegalArgumentException: Error loading configuration file conf\generate-sdf-content-types : File not found; Source name

To solve this we copied the .\conf folder with the included files to your .\bin directory so you land up with a path .\bin\conf

 

Error:

Unable to open the credential file for reading “c:\correct\path\to\file\specified”

The other issue we had was it was not finding the file we create that contains the accessKey and the secretKey even though the path was specified correctly under System -> Environment Variables and using the set AWS_CREDENTIAL_FILE=credential_file_path on windows. The only way we could resolve this was to provide the path to the credential file using the command line parameter -c
E.g.  cs-generate-sdf –source “C:\path\to\files\*.txt” –output “C:\path\to\output” -d domain -c “C:\path\to\AWS_CREDENTIAL_FILE\aws.txt”

 

Error:

Content exceeds max limit, truncating to: 3 MB

We need to change this as the current The maximum batch size is 5 MB. However we neither of the two parameters (–batch-size or -bs) appear to be working.

 

Author: admin

See all posts by (18)

Leave a Reply