Get all available regions for the Amazon CloudSearch service.
Return type: | list |
---|---|
Returns: | A list of boto.regioninfo.RegionInfo |
A Cloudsearch domain.
Variables: |
|
---|
Constructor - Create a domain object from a layer1 and data params
Parameters: | layer1 (boto.cloudsearch2.layer1.Layer1 object) – A boto.cloudsearch2.layer1.Layer1 object which is used to perform operations on the domain. |
---|
Create a new expression.
Parameters: |
|
---|---|
Returns: | ExpressionStatus object |
Return type: | boto.cloudsearch2.option.ExpressionStatus object |
Raises: | BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException |
Defines an IndexField, either replacing an existing definition or creating a new one.
Parameters: |
|
---|---|
Returns: | IndexFieldStatus objects |
Return type: | boto.cloudsearch2.option.IndexFieldStatus object |
Raises: | BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException |
Delete this domain and all index data associated with it.
Return a boto.cloudsearch2.option.ServicePoliciesStatus object representing the currently defined access policies for the domain. :return: ServicePoliciesStatus object :rtype: boto.cloudsearch2.option.ServicePoliciesStatus object
Return a list of Analysis Scheme objects.
Return a boto.cloudsearch2.option.AvailabilityOptionsStatus object representing the currently defined availability options for the domain. :return: OptionsStatus object :rtype: boto.cloudsearch2.option.AvailabilityOptionsStatus
object
Return a list of rank expressions defined for this domain. :return: list of ExpressionStatus objects :rtype: list of boto.cloudsearch2.option.ExpressionStatus
object
Return a list of index fields defined for this domain. :return: list of IndexFieldStatus objects :rtype: list of boto.cloudsearch2.option.IndexFieldStatus
object
Return a boto.cloudsearch2.option.ScalingParametersStatus object representing the currently defined scaling options for the domain. :return: ScalingParametersStatus object :rtype: boto.cloudsearch2.option.ScalingParametersStatus
object
Tells the search domain to start indexing its documents using the latest text processing options and IndexFields. This operation must be invoked to make options whose OptionStatus has OptionState of RequiresIndexDocuments visible in search results.
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`_.
alias of JSONResponseError
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: |
---|
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). |
---|
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. |
---|
Configures an analysis scheme that can be applied to a text or text-array field to define language-specific text processing options. For more information, see `Configuring Analysis Schemes`_ in the Amazon CloudSearch Developer Guide .
Parameters: |
|
---|
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: |
|
---|
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: |
|
---|
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: |
|
---|
Deletes an analysis scheme. For more information, see `Configuring Analysis Schemes`_ in the Amazon CloudSearch Developer Guide .
Parameters: |
|
---|
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. |
---|
Removes an Expression from the search domain. For more information, see `Configuring Expressions`_ in the Amazon CloudSearch Developer Guide .
Parameters: |
|
---|
Removes an IndexField from the search domain. For more information, see `Configuring Index Fields`_ in the Amazon CloudSearch Developer Guide .
Parameters: |
|
---|
Deletes a suggester. For more information, see `Getting Search Suggestions`_ in the Amazon CloudSearch Developer Guide .
Parameters: |
|
---|
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: |
---|
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: |
|
---|
Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default. To get the number of searchable documents in a domain, use the console or submit a matchall request to your domain’s search endpoint: q=matchall&q.parser=structured&size=0. 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. |
---|
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: |
|
---|
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: |
|
---|
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). |
---|
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: |
|
---|
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: |
---|
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). |
---|
Lists all search domains owned by an account.
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: |
|
---|
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: |
|
---|
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: |
|
---|
Create a new CloudSearch domain and return the corresponding object. :return: Domain object, or None if the domain isn’t found :rtype: boto.cloudsearch2.domain.Domain
Return a list of objects for each domain defined in the current account. :rtype: list of boto.cloudsearch2.domain.Domain
Lookup a single domain :param domain_name: The name of the domain to look up :type domain_name: str
Returns: | Domain object, or None if the domain isn’t found |
---|---|
Return type: | boto.cloudsearch2.domain.Domain |
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: |
|
---|
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.
Write the current state of the local object back to the CloudSearch service.
Return the JSON representation of the options as a string.
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. |
---|
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. |
---|
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. |
---|
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. |
---|
Returns a new policy statement that will allow access to the service described by arn by the ip specified in ip.
Parameters: |
---|
Transform search parameters from instance properties to a dictionary
Return type: | dict |
---|---|
Returns: | search parameters |
Get a generator to iterate over all search results
Transparently handles the results paging from Cloudsearch search results so even if you have many thousands of results you can iterate over all results in a reasonably efficient manner.
Parameters: | query (boto.cloudsearch2.search.Query) – A group of search criteria |
---|---|
Return type: | generator |
Returns: | All docs matching query |
Get a generator to iterate over all pages of search results
Parameters: |
|
---|---|
Return type: | generator |
Returns: | Generator containing boto.cloudsearch2.search.SearchResults |
Return the total number of hits for query
Parameters: | query (boto.cloudsearch2.search.Query) – a group of search criteria |
---|---|
Return type: | int |
Returns: | Total number of hits for query |
Send a query to CloudSearch
Each search query should use at least the q or bq argument to specify the search parameter. The other options are used to specify the criteria of the search.
Parameters: |
|
---|---|
Return type: | |
Returns: | Returns the results of this search |
The following examples all assume we have indexed a set of documents with fields: author, date, headline
A simple search will look for documents whose default text search fields will contain the search word exactly:
>>> search(q='Tim') # Return documents with the word Tim in them (but not Timothy)
A simple search with more keywords will return documents whose default text search fields contain the search strings together or separately.
>>> search(q='Tim apple') # Will match "tim" and "apple"
More complex searches require the boolean search operator.
Wildcard searches can be used to search for any words that start with the search string.
>>> search(q="'Tim*'") # Return documents with words like Tim or Timothy)
Search terms can also be combined. Allowed operators are “and”, “or”, “not”, “field”, “optional”, “token”, “phrase”, or “filter”
>>> search(q="(and 'Tim' (field author 'John Smith'))", parser='structured')
Facets allow you to show classification information about the search results. For example, you can retrieve the authors who have written about Tim with a max of 3
>>> search(q='Tim', facet={'Author': '{sort:"bucket", size:3}'})
Call Cloudsearch to get the next page of search results
Return type: | boto.cloudsearch2.search.SearchResults |
---|---|
Returns: | the following page of search results |
Wrapper for response to Cloudsearch document batch commit.
Parameters: |
|
---|---|
Raises: | |
Raises: | |
Raises: | |
Raises: |
Content sent for Cloud Search indexing was too long
This will usually happen when documents queued for indexing add up to more than the limit allowed per upload batch (5MB)
A CloudSearch document service.
The DocumentServiceConection is used to add, remove and update documents in CloudSearch. Commands are uploaded to CloudSearch in SDF (Search Document Format).
To generate an appropriate SDF, use add() to add or update documents, as well as delete() to remove documents.
Once the set of documents is ready to be index, use commit() to send the commands to CloudSearch.
If there are a lot of documents to index, it may be preferable to split the generation of SDF data and the actual uploading into CloudSearch. Retrieve the current SDF with get_sdf(). If this file is the uploaded into S3, it can be retrieved back afterwards for upload into CloudSearch using add_sdf_from_s3().
The SDF is not cleared after a commit(). If you wish to continue using the DocumentServiceConnection for another batch upload of commands, you will need to clear_sdf() first to stop the previous batch of commands from being uploaded again.
Add a document to be processed by the DocumentService
The document will not actually be added until commit() is called
Parameters: |
---|
Load an SDF from S3
Using this method will result in documents added through add() and delete() being ignored.
Parameters: | key_obj (boto.s3.key.Key) – An S3 key which contains an SDF |
---|
Clear the working documents from this DocumentServiceConnection
This should be used after commit() if the connection will be reused for another set of documents.
Actually send an SDF to CloudSearch for processing
If an SDF file has been explicitly loaded it will be used. Otherwise, documents added through add() and delete() will be used.
Return type: | CommitResponse |
---|---|
Returns: | A summary of documents added and deleted |
Schedule a document to be removed from the CloudSearch service
The document will not actually be scheduled for removal until commit() is called
Parameters: | _id (string) – The unique ID of this document. |
---|
Generate the working set of documents in Search Data Format (SDF)
Return type: | string |
---|---|
Returns: | JSON-formatted string of the documents in SDF |
Content sent for Cloud Search indexing was incorrectly encoded.
This usually happens when a document is marked as unicode but non-unicode characters are present.