Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Make endopoints configurable. #4

wants to merge 1 commit into from

3 participants

Yoji Shidara Dave Jensen Alex Soto
Yoji Shidara

We are now developing Groonga CluodSearch, an open source implementation of Amazon CloudSearch.

Groonga CloudSearch can work with aws_cloud_search by monkey patching
that directs the requests toward the host running Groonga CloudSearch instead of Amazon CloudSearch.

It would be great if aws_cloud_search can pick the base domain name of doc and search endpoints and URL of configuration endpoint. With this patch, we can initiate AWSCloudSearch::CloudSearch object like below:

cloud_search =
  endpoint_base_domain: '',
  configuration_url: 'http://localhost:7575'

How do you think? I'd like to hear your thought.

Dave Jensen

Yes, the endpoints should be more configurable. We will review your pull request.

Yoji Shidara

Are there any updates on this?

Alex Soto

I'd like to comment that although it's 'nice' that the endpoint urls are 'derived' from some base value and you prepend 'search' and add the region and base AWS url, you should make the entire url configurable.

CloudSearch only allows IP based security, and our app runs on heroku which doesn't have a static ip. To work around it we are currently running our doc updates through a proxy with a static ip. Therefore, our doc upload url isn't even the standard url. Making the url configurable and allowing you to point to any url you want would be more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 26, 2012
  1. Yoji Shidara

    Make endopoints configurable.

    darashi authored
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 10 deletions.
  1. +14 −6 lib/aws_cloud_search.rb
  2. +3 −4 lib/aws_cloud_search/cloud_search.rb
20 lib/aws_cloud_search.rb
@@ -18,17 +18,25 @@ module AWSCloudSearch
# for future reference in case AWS-CS updates to XML 1.1 char compliance
#INVALID_CHAR_XML11 = /[^\u0001-\uD7FF\uE000-\uFFFD]/m
+ region: 'us-east-1',
+ endpoint_base_domain: '',
+ configuration_url: ''
+ }.freeze
- def self.search_url(domain, region="us-east-1")
- "http://search-#{domain}.#{region}"
+ def self.search_url(domain, options={})
+ options = DEFAULT_OPTIONS.merge(options)
+ "http://search-#{domain}.#{options[:region]}.#{options[:endpoint_base_domain]}"
- def self.document_url(domain, region="us-east-1")
- "http://doc-#{domain}.#{region}"
+ def self.document_url(domain, options={})
+ options = DEFAULT_OPTIONS.merge(options)
+ "http://doc-#{domain}.#{options[:region]}.#{options[:endpoint_base_domain]}"
- def self.configuration_url
- ""
+ def self.configuration_url(options={})
+ options = DEFAULT_OPTIONS.merge(options)
+ options[:configuration_url]
# Initialize the module
7 lib/aws_cloud_search/cloud_search.rb
@@ -3,10 +3,9 @@
module AWSCloudSearch
class CloudSearch
- def initialize(domain, region="us-east-1")
- @doc_conn = AWSCloudSearch::create_connection( AWSCloudSearch::document_url(domain, region) )
- @search_conn = AWSCloudSearch::create_connection( AWSCloudSearch::search_url(domain, region) )
+ def initialize(domain, options={})
+ @doc_conn = AWSCloudSearch::create_connection( AWSCloudSearch::document_url(domain, options) )
+ @search_conn = AWSCloudSearch::create_connection( AWSCloudSearch::search_url(domain, options) )
# Sends a batch of document updates and deletes by invoking the CloudSearch documents/batch API
Something went wrong with that request. Please try again.