Cloudsearch

boto.cloudsearch2

boto.cloudsearch2.connect_to_region(region_name, **kw_params)
boto.cloudsearch2.regions()

Get all available regions for the Amazon CloudSearch service.

Return type:list
Returns:A list of boto.regioninfo.RegionInfo

boto.cloudsearch2.domain

boto.cloudsearch2.layer1

class boto.cloudsearch2.layer1.CloudSearchConnection(**kwargs)

Amazon CloudSearch Configuration Service You use the Amazon CloudSearch configuration service to create, configure, and manage search domains. Configuration service requests are submitted using the AWS Query protocol. AWS Query requests are HTTP or HTTPS requests submitted via HTTP GET or POST with a query parameter named Action.

The endpoint for configuration service requests is region- specific: cloudsearch. region .amazonaws.com. For example, cloudsearch.us-east-1.amazonaws.com. For a current list of supported regions and endpoints, see `Regions and Endpoints`_.

APIVersion = '2013-01-01'
DefaultRegionEndpoint = 'cloudsearch.us-east-1.amazonaws.com'
DefaultRegionName = 'us-east-1'
ResponseError

alias of JSONResponseError

build_complex_param(params, label, value)

Serialize a structure.

For example:

param_type = 'structure'
label = 'IndexField'
value = {'IndexFieldName': 'a', 'IntOptions': {'DefaultValue': 5}}

would result in the params dict being updated with these params:

IndexField.IndexFieldName = a
IndexField.IntOptions.DefaultValue = 5
Parameters:
  • params (dict) – The params dict. The complex list params will be added to this dict.
  • label (str) – String label for param key
  • value (any) – The value to serialize
build_suggesters(domain_name)

Indexes the search suggestions.

Parameters:domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
create_domain(domain_name)

Creates a new search domain. For more information, see `Creating a Search Domain`_ in the Amazon CloudSearch Developer Guide .

Parameters:domain_name (string) – A name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.
define_analysis_scheme(domain_name, analysis_scheme)

Configures an analysis scheme for a domain. An analysis scheme defines language-specific text processing options for a text field. For more information, see `Configuring Analysis Schemes`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • analysis_scheme (dict) – Configuration information for an analysis scheme. Each analysis scheme has a unique name and specifies the language of the text to be processed. The following options can be configured for an analysis scheme: Synonyms, Stopwords, StemmingDictionary, and AlgorithmicStemming.
define_expression(domain_name, expression)

Configures an Expression for the search domain. Used to create new expressions and modify existing ones. If the expression exists, the new configuration replaces the old one. For more information, see `Configuring Expressions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • expression (dict) – A named expression that can be evaluated at search time. Can be used for sorting and filtering search results and constructing other expressions.
define_index_field(domain_name, index_field)

Configures an IndexField for the search domain. Used to create new fields and modify existing ones. You must specify the name of the domain you are configuring and an index field configuration. The index field configuration specifies a unique name, the index field type, and the options you want to configure for the field. The options you can specify depend on the IndexFieldType. If the field exists, the new configuration replaces the old one. For more information, see `Configuring Index Fields`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • index_field (dict) – The index field and field options you want to configure.
define_suggester(domain_name, suggester)

Configures a suggester for a domain. A suggester enables you to display possible matches before users finish typing their queries. When you configure a suggester, you must specify the name of the text field you want to search for possible matches and a unique name for the suggester. For more information, see `Getting Search Suggestions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • suggester (dict) – Configuration information for a search suggester. Each suggester has a unique name and specifies the text field you want to use for suggestions. The following options can be configured for a suggester: FuzzyMatching, SortExpression.
delete_analysis_scheme(domain_name, analysis_scheme_name)

Deletes an analysis scheme. For more information, see `Configuring Analysis Schemes`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • analysis_scheme_name (string) – The name of the analysis scheme you want to delete.
delete_domain(domain_name)

Permanently deletes a search domain and all of its data. Once a domain has been deleted, it cannot be recovered. For more information, see `Deleting a Search Domain`_ in the Amazon CloudSearch Developer Guide .

Parameters:domain_name (string) – The name of the domain you want to permanently delete.
delete_expression(domain_name, expression_name)

Removes an Expression from the search domain. For more information, see `Configuring Expressions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • expression_name (string) – The name of the Expression to delete.
delete_index_field(domain_name, index_field_name)

Removes an IndexField from the search domain. For more information, see `Configuring Index Fields`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • index_field_name (string) – The name of the index field your want to remove from the domain’s indexing options.
delete_suggester(domain_name, suggester_name)

Deletes a suggester. For more information, see `Getting Search Suggestions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • suggester_name (string) – Specifies the name of the suggester you want to delete.
describe_analysis_schemes(domain_name, analysis_scheme_names=None, deployed=None)

Gets the analysis schemes configured for a domain. An analysis scheme defines language-specific text processing options for a text field. Can be limited to specific analysis schemes by name. By default, shows all analysis schemes and includes any pending changes to the configuration. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Configuring Analysis Schemes`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • analysis_scheme_names (list) – The analysis schemes you want to describe.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
describe_availability_options(domain_name, deployed=None)

Gets the availability options configured for a domain. By default, shows the configuration with any pending changes. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Configuring Availability Options`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
describe_domains(domain_names=None)

Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default. For more information, see `Getting Information about a Search Domain`_ in the Amazon CloudSearch Developer Guide .

Parameters:domain_names (list) – The names of the domains you want to include in the response.
describe_expressions(domain_name, expression_names=None, deployed=None)

Gets the expressions configured for the search domain. Can be limited to specific expressions by name. By default, shows all expressions and includes any pending changes to the configuration. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Configuring Expressions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • expression_names (list) – Limits the DescribeExpressions response to the specified expressions. If not specified, all expressions are shown.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
describe_index_fields(domain_name, field_names=None, deployed=None)

Gets information about the index fields configured for the search domain. Can be limited to specific fields by name. By default, shows all fields and includes any pending changes to the configuration. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Getting Domain Information`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • field_names (list) – A list of the index fields you want to describe. If not specified, information is returned for all configured index fields.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
describe_scaling_parameters(domain_name)

Gets the scaling parameters configured for a domain. A domain’s scaling parameters specify the desired search instance type and replication count. For more information, see `Configuring Scaling Options`_ in the Amazon CloudSearch Developer Guide .

Parameters:domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
describe_service_access_policies(domain_name, deployed=None)

Gets information about the access policies that control access to the domain’s document and search endpoints. By default, shows the configuration with any pending changes. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Configuring Access for a Search Domain`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
describe_suggesters(domain_name, suggester_names=None, deployed=None)

Gets the suggesters configured for a domain. A suggester enables you to display possible matches before users finish typing their queries. Can be limited to specific suggesters by name. By default, shows all suggesters and includes any pending changes to the configuration. Set the Deployed option to True to show the active configuration and exclude pending changes. For more information, see `Getting Search Suggestions`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – The name of the domain you want to describe.
  • suggester_names (list) – The suggesters you want to describe.
  • deployed (boolean) – Whether to display the deployed configuration ( True) or include any pending changes ( False). Defaults to False.
index_documents(domain_name)

Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is RequiresIndexDocuments.

Parameters:domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
list_domain_names()

Lists all search domains owned by an account.

update_availability_options(domain_name, multi_az)

Configures the availability options for a domain. Enabling the Multi-AZ option expands an Amazon CloudSearch domain to an additional Availability Zone in the same Region to increase fault tolerance in the event of a service disruption. Changes to the Multi-AZ option can take about half an hour to become active. For more information, see `Configuring Availability Options`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • multi_az (boolean) – You expand an existing search domain to a second Availability Zone by setting the Multi-AZ option to true. Similarly, you can turn off the Multi-AZ option to downgrade the domain to a single Availability Zone by setting the Multi-AZ option to False.
update_scaling_parameters(domain_name, scaling_parameters)

Configures scaling parameters for a domain. A domain’s scaling parameters specify the desired search instance type and replication count. Amazon CloudSearch will still automatically scale your domain based on the volume of data and traffic, but not below the desired instance type and replication count. If the Multi-AZ option is enabled, these values control the resources used per Availability Zone. For more information, see `Configuring Scaling Options`_ in the Amazon CloudSearch Developer Guide .

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • scaling_parameters (dict) – The desired instance type and desired number of replicas of each index partition.
update_service_access_policies(domain_name, access_policies)

Configures the access rules that control access to the domain’s document and search endpoints. For more information, see ` Configuring Access for an Amazon CloudSearch Domain`_.

Parameters:
  • domain_name (string) – A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
  • access_policies (string) – The access rules you want to configure. These rules replace any existing rules.

boto.cloudsearch2.layer2

boto.cloudsearch2.optionstatus

class boto.cloudsearch2.optionstatus.AvailabilityOptionsStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)
save()
class boto.cloudsearch2.optionstatus.ExpressionStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)
class boto.cloudsearch2.optionstatus.IndexFieldStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)
save()
class boto.cloudsearch2.optionstatus.OptionStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)

Presents a combination of status field (defined below) which are accessed as attributes and option values which are stored in the native Python dictionary. In this class, the option values are merged from a JSON object that is stored as the Option part of the object.

Variables:
  • domain_name – The name of the domain this option is associated with.
  • create_date – A timestamp for when this option was created.
  • state

    The state of processing a change to an option. Possible values:

    • RequiresIndexDocuments: the option’s latest value will not be visible in searches until IndexDocuments has been called and indexing is complete.
    • Processing: the option’s latest value is not yet visible in all searches but is in the process of being activated.
    • Active: the option’s latest value is completely visible.
  • update_date – A timestamp for when this option was updated.
  • update_version – A unique integer that indicates when this option was last updated.
refresh(data=None)

Refresh the local state of the object. You can either pass new state data in as the parameter data or, if that parameter is omitted, the state data will be retrieved from CloudSearch.

save()

Write the current state of the local object back to the CloudSearch service.

to_json()

Return the JSON representation of the options as a string.

class boto.cloudsearch2.optionstatus.ScalingParametersStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)
class boto.cloudsearch2.optionstatus.ServicePoliciesStatus(domain, data=None, refresh_fn=None, refresh_key=None, save_fn=None)
allow_doc_ip(ip)

Add the provided ip address or CIDR block to the list of allowable address for the document service.

Parameters:ip (string) – An IP address or CIDR block you wish to grant access to.
allow_search_ip(ip)

Add the provided ip address or CIDR block to the list of allowable address for the search service.

Parameters:ip (string) – An IP address or CIDR block you wish to grant access to.
disallow_doc_ip(ip)

Remove the provided ip address or CIDR block from the list of allowable address for the document service.

Parameters:ip (string) – An IP address or CIDR block you wish to grant access to.
disallow_search_ip(ip)

Remove the provided ip address or CIDR block from the list of allowable address for the search service.

Parameters:ip (string) – An IP address or CIDR block you wish to grant access to.
new_statement(arn, ip)

Returns a new policy statement that will allow access to the service described by arn by the ip specified in ip.

Parameters:
  • arn (string) – The Amazon Resource Notation identifier for the service you wish to provide access to. This would be either the search service or the document service.
  • ip (string) – An IP address or CIDR block you wish to grant access to.

boto.cloudsearch2.document