Cloudsearch¶
boto.cloudsearch.domain¶
-
class
boto.cloudsearch.domain.
Domain
(layer1, data)¶ A Cloudsearch domain.
Variables: - name – The name of the domain.
- id – The internally generated unique identifier for the domain.
- created – A boolean which is True if the domain is created. It can take several minutes to initialize a domain when CreateDomain is called. Newly created search domains are returned with a False value for Created until domain creation is complete
- deleted – A boolean which is True if the search domain has been deleted. The system must clean up resources dedicated to the search domain when delete is called. Newly deleted search domains are returned from list_domains with a True value for deleted for several minutes until resource cleanup is complete.
- processing – True if processing is being done to activate the current domain configuration.
- num_searchable_docs – The number of documents that have been submittted to the domain and indexed.
- requires_index_document – True if index_documents needs to be called to activate the current domain configuration.
- search_instance_count – The number of search instances that are available to process search requests.
- search_instance_type – The instance type that is being used to process search requests.
- search_partition_count – The number of partitions across which the search index is spread.
-
create_index_field
(field_name, field_type, default='', facet=False, result=False, searchable=False, source_attributes=[])¶ Defines an
IndexField
, either replacing an existing definition or creating a new one.Parameters: - field_name (string) – The name of a field in the search index.
- field_type (string) – The type of field. Valid values are uint | literal | text
- default (string or int) – The default value for the field. If the
field is of type
uint
this should be an integer value. Otherwise, it’s a string. - facet (bool) – A boolean to indicate whether facets
are enabled for this field or not. Does not apply to
fields of type
uint
. - results (bool) – A boolean to indicate whether values
of this field can be returned in search results or
used in ranking. Does not apply to fields of type
uint
. - searchable (bool) – A boolean to indicate whether search
is enabled for this field or not. Applies only to fields
of type
literal
. - source_attributes (list of dicts) –
An optional list of dicts that provide information about attributes for this index field. A maximum of 20 source attributes can be configured for each index field.
Each item in the list is a dict with the following keys:
- data_copy - The value is a dict with the following keys:
- default - Optional default value if the source attribute
- is not specified in a document.
- name - The name of the document source field to add
- to this
IndexField
.
- data_function - Identifies the transformation to apply
- when copying data from a source attribute.
- data_map - The value is a dict with the following keys:
- cases - A dict that translates source field values
- to custom values.
- default - An optional default value to use if the
- source attribute is not specified in a document.
- name - the name of the document source field to add
- to this
IndexField
- data_trim_title - Trims common title words from a source
- document attribute when populating an
IndexField
. This can be used to create anIndexField
you can use for sorting. The value is a dict with the following fields: * default - An optional default value. * language - an IETF RFC 4646 language code. * separator - The separator that follows the text to trim. * name - The name of the document source field to add.
Raises: BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException
-
create_rank_expression
(name, expression)¶ Create a new rank expression.
Parameters: - rank_name (string) – The name of an expression computed for ranking while processing a search request.
- rank_expression (string) –
The expression to evaluate for ranking or thresholding while processing a search request. The RankExpression syntax is based on JavaScript expressions and supports:
- Integer, floating point, hex and octal literals
- Shortcut evaluation of logical operators such that an
- expression a || b evaluates to the value a if a is true without evaluting b at all
- JavaScript order of precedence for operators
- Arithmetic operators: + - * / %
- Boolean operators (including the ternary operator)
- Bitwise operators
- Comparison operators
- Common mathematic functions: abs ceil erf exp floor
- lgamma ln log2 log10 max min sqrt pow
- Trigonometric library functions: acosh acos asinh asin
- atanh atan cosh cos sinh sin tanh tan
- Random generation of a number between 0 and 1: rand
- Current time in epoch: time
- The min max functions that operate on a variable argument list
Intermediate results are calculated as double precision floating point values. The final return value of a RankExpression is automatically converted from floating point to a 32-bit unsigned integer by rounding to the nearest integer, with a natural floor of 0 and a ceiling of max(uint32_t), 4294967295. Mathematical errors such as dividing by 0 will fail during evaluation and return a value of 0.
The source data for a RankExpression can be the name of an IndexField of type uint, another RankExpression or the reserved name text_relevance. The text_relevance source is defined to return an integer from 0 to 1000 (inclusive) to indicate how relevant a document is to the search request, taking into account repetition of search terms in the document and proximity of search terms to each other in each matching IndexField in the document.
For more information about using rank expressions to customize ranking, see the Amazon CloudSearch Developer Guide.
Raises: BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException
-
created
¶
-
delete
()¶ Delete this domain and all index data associated with it.
-
deleted
¶
-
doc_service_arn
¶
-
doc_service_endpoint
¶
-
get_access_policies
()¶ Return a
boto.cloudsearch.option.OptionStatus
object representing the currently defined access policies for the domain.
-
get_document_service
()¶
-
get_index_fields
(field_names=None)¶ Return a list of index fields defined for this domain.
-
get_rank_expressions
(rank_names=None)¶ Return a list of rank expressions defined for this domain.
-
get_search_service
()¶
-
get_stemming
()¶ Return a
boto.cloudsearch.option.OptionStatus
object representing the currently defined stemming options for the domain.
-
get_stopwords
()¶ Return a
boto.cloudsearch.option.OptionStatus
object representing the currently defined stopword options for the domain.
-
get_synonyms
()¶ Return a
boto.cloudsearch.option.OptionStatus
object representing the currently defined synonym options for the domain.
-
id
¶
-
index_documents
()¶ 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 OptioState of RequiresIndexDocuments visible in search results.
-
name
¶
-
num_searchable_docs
¶
-
processing
¶
-
requires_index_documents
¶
-
search_instance_count
¶
-
search_partition_count
¶
-
search_service_arn
¶
-
search_service_endpoint
¶
-
update_from_data
(data)¶
-
boto.cloudsearch.domain.
handle_bool
(value)¶
boto.cloudsearch.layer1¶
-
class
boto.cloudsearch.layer1.
Layer1
(aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, host=None, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, debug=0, https_connection_factory=None, region=None, path='/', api_version=None, security_token=None)¶ -
APIVersion
= '2011-02-01'¶
-
DefaultRegionEndpoint
= 'cloudsearch.us-east-1.amazonaws.com'¶
-
DefaultRegionName
= 'us-east-1'¶
-
create_domain
(domain_name)¶ Create a new search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, LimitExceededException
-
define_index_field
(domain_name, field_name, field_type, default='', facet=False, result=False, searchable=False, source_attributes=None)¶ Defines an
IndexField
, either replacing an existing definition or creating a new one.Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- field_name (string) – The name of a field in the search index.
- field_type (string) – The type of field. Valid values are uint | literal | text
- default (string or int) – The default value for the field. If the
field is of type
uint
this should be an integer value. Otherwise, it’s a string. - facet (bool) – A boolean to indicate whether facets
are enabled for this field or not. Does not apply to
fields of type
uint
. - results (bool) – A boolean to indicate whether values
of this field can be returned in search results or
used in ranking. Does not apply to fields of type
uint
. - searchable (bool) – A boolean to indicate whether search
is enabled for this field or not. Applies only to fields
of type
literal
. - source_attributes (list of dicts) –
An optional list of dicts that provide information about attributes for this index field. A maximum of 20 source attributes can be configured for each index field.
Each item in the list is a dict with the following keys:
- data_copy - The value is a dict with the following keys:
- default - Optional default value if the source attribute
- is not specified in a document.
- name - The name of the document source field to add
- to this
IndexField
.
- data_function - Identifies the transformation to apply
- when copying data from a source attribute.
- data_map - The value is a dict with the following keys:
- cases - A dict that translates source field values
- to custom values.
- default - An optional default value to use if the
- source attribute is not specified in a document.
- name - the name of the document source field to add
- to this
IndexField
- data_trim_title - Trims common title words from a source
- document attribute when populating an
IndexField
. This can be used to create anIndexField
you can use for sorting. The value is a dict with the following fields: * default - An optional default value. * language - an IETF RFC 4646 language code. * separator - The separator that follows the text to trim. * name - The name of the document source field to add.
Raises: BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException
-
define_rank_expression
(domain_name, rank_name, rank_expression)¶ Defines a RankExpression, either replacing an existing definition or creating a new one.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- rank_name (string) – The name of an expression computed for ranking while processing a search request.
- rank_expression (string) –
The expression to evaluate for ranking or thresholding while processing a search request. The RankExpression syntax is based on JavaScript expressions and supports:
- Integer, floating point, hex and octal literals
- Shortcut evaluation of logical operators such that an
- expression a || b evaluates to the value a if a is true without evaluting b at all
- JavaScript order of precedence for operators
- Arithmetic operators: + - * / %
- Boolean operators (including the ternary operator)
- Bitwise operators
- Comparison operators
- Common mathematic functions: abs ceil erf exp floor
- lgamma ln log2 log10 max min sqrt pow
- Trigonometric library functions: acosh acos asinh asin
- atanh atan cosh cos sinh sin tanh tan
- Random generation of a number between 0 and 1: rand
- Current time in epoch: time
- The min max functions that operate on a variable argument list
Intermediate results are calculated as double precision floating point values. The final return value of a RankExpression is automatically converted from floating point to a 32-bit unsigned integer by rounding to the nearest integer, with a natural floor of 0 and a ceiling of max(uint32_t), 4294967295. Mathematical errors such as dividing by 0 will fail during evaluation and return a value of 0.
The source data for a RankExpression can be the name of an IndexField of type uint, another RankExpression or the reserved name text_relevance. The text_relevance source is defined to return an integer from 0 to 1000 (inclusive) to indicate how relevant a document is to the search request, taking into account repetition of search terms in the document and proximity of search terms to each other in each matching IndexField in the document.
For more information about using rank expressions to customize ranking, see the Amazon CloudSearch Developer Guide.
Raises: BaseException, InternalException, LimitExceededException, InvalidTypeException, ResourceNotFoundException
-
delete_domain
(domain_name)¶ Delete a search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException
-
delete_index_field
(domain_name, field_name)¶ Deletes an existing
IndexField
from the search domain.Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- field_name (string) – A string that represents the name of an index field. Field names must begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Uppercase letters and hyphens are not allowed. The names “body”, “docid”, and “text_relevance” are reserved and cannot be specified as field or rank expression names.
Raises: BaseException, InternalException, ResourceNotFoundException
-
delete_rank_expression
(domain_name, rank_name)¶ Deletes an existing
RankExpression
from the search domain.Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- rank_name (string) – Name of the
RankExpression
to delete.
Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_default_search_field
(domain_name)¶ Describes options defining the default search field used by indexing for the search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_domains
(domain_names=None)¶ Describes the domains (optionally limited to one or more domains by name) owned by this account.
Parameters: domain_names (list) – Limits the response to the specified domains. Raises: BaseException, InternalException
-
describe_index_fields
(domain_name, field_names=None)¶ Describes index fields in the search domain, optionally limited to a single
IndexField
.Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- field_names (list) – Limits the response to the specified fields.
Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_rank_expressions
(domain_name, rank_names=None)¶ Describes RankExpressions in the search domain, optionally limited to a single expression.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- rank_names (list) – Limit response to the specified rank names.
Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_service_access_policies
(domain_name)¶ Describes the resource-based policies controlling access to the services in this search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_stemming_options
(domain_name)¶ Describes stemming options used by indexing for the search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_stopword_options
(domain_name)¶ Describes stopword options used by indexing for the search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
describe_synonym_options
(domain_name)¶ Describes synonym options used by indexing for the search domain.
Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
get_response
(doc_path, action, params, path='/', parent=None, verb='GET', list_marker=None)¶
-
index_documents
(domain_name)¶ Tells the search domain to start scanning its documents using the latest text processing options and
IndexFields
. This operation must be invoked to make visible in searches any options whose <a>OptionStatus</a> hasOptionState
ofRequiresIndexDocuments
.Parameters: domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed. Raises: BaseException, InternalException, ResourceNotFoundException
-
update_default_search_field
(domain_name, default_search_field)¶ Updates options defining the default search field used by indexing for the search domain.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- default_search_field (string) – The IndexField to use for search requests issued with the q parameter. The default is an empty string, which automatically searches all text fields.
Raises: BaseException, InternalException, InvalidTypeException, ResourceNotFoundException
-
update_service_access_policies
(domain_name, access_policies)¶ Updates the policies controlling access to the services in this search domain.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- access_policies (string) – An IAM access policy as described in The Access Policy Language in Using AWS Identity and Access Management. The maximum size of an access policy document is 100KB.
Raises: BaseException, InternalException, LimitExceededException, ResourceNotFoundException, InvalidTypeException
-
update_stemming_options
(domain_name, stems)¶ Updates stemming options used by indexing for the search domain.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- stems (string) – Maps terms to their stems. The JSON object has a single key called “stems” whose value is a dict mapping terms to their stems. The maximum size of a stemming document is 500KB. Example: {“stems”:{“people”: “person”, “walking”:”walk”}}
Raises: BaseException, InternalException, InvalidTypeException, LimitExceededException, ResourceNotFoundException
-
update_stopword_options
(domain_name, stopwords)¶ Updates stopword options used by indexing for the search domain.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- stopwords (string) – Lists stopwords in a JSON object. The object has a single key called “stopwords” whose value is an array of strings. The maximum size of a stopwords document is 10KB. Example: {“stopwords”: [“a”, “an”, “the”, “of”]}
Raises: BaseException, InternalException, InvalidTypeException, LimitExceededException, ResourceNotFoundException
-
update_synonym_options
(domain_name, synonyms)¶ Updates synonym options used by indexing for the search domain.
Parameters: - domain_name (string) – A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). Uppercase letters and underscores are not allowed.
- synonyms (string) – Maps terms to their synonyms. The JSON object has a single key “synonyms” whose value is a dict mapping terms to their synonyms. Each synonym is a simple string or an array of strings. The maximum size of a stopwords document is 100KB. Example: {“synonyms”: {“cat”: [“feline”, “kitten”], “puppy”: “dog”}}
Raises: BaseException, InternalException, InvalidTypeException, LimitExceededException, ResourceNotFoundException
-
-
boto.cloudsearch.layer1.
do_bool
(val)¶
boto.cloudsearch.layer2¶
-
class
boto.cloudsearch.layer2.
Layer2
(aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, host=None, debug=0, session_token=None, region=None)¶ -
create_domain
(domain_name)¶ Create a new CloudSearch domain and return the corresponding
boto.cloudsearch.domain.Domain
object.
-
list_domains
(domain_names=None)¶ Return a list of
boto.cloudsearch.domain.Domain
objects for each domain defined in the current account.
-
boto.cloudsearch.optionstatus¶
-
class
boto.cloudsearch.optionstatus.
IndexFieldStatus
(domain, data=None, refresh_fn=None, save_fn=None)¶ -
save
()¶
-
-
class
boto.cloudsearch.optionstatus.
OptionStatus
(domain, data=None, refresh_fn=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.
-
endElement
(name, value, connection)¶
-
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.
-
startElement
(name, attrs, connection)¶
-
to_json
()¶ Return the JSON representation of the options as a string.
-
wait_for_state
(state)¶ Performs polling of CloudSearch to wait for the
state
of this object to change to the provided state.
-
class
boto.cloudsearch.optionstatus.
RankExpressionStatus
(domain, data=None, refresh_fn=None, save_fn=None)¶
-
class
boto.cloudsearch.optionstatus.
ServicePoliciesStatus
(domain, data=None, refresh_fn=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 inip
.Parameters:
-
boto.cloudsearch.search¶
-
exception
boto.cloudsearch.search.
CommitMismatchError
¶
-
class
boto.cloudsearch.search.
Query
(q=None, bq=None, rank=None, return_fields=None, size=10, start=0, facet=None, facet_constraints=None, facet_sort=None, facet_top_n=None, t=None)¶ -
RESULTS_PER_PAGE
= 500¶
-
to_params
()¶ Transform search parameters from instance properties to a dictionary
Return type: dict Returns: search parameters
-
update_size
(new_size)¶
-
-
class
boto.cloudsearch.search.
SearchConnection
(domain=None, endpoint=None)¶ -
build_query
(q=None, bq=None, rank=None, return_fields=None, size=10, start=0, facet=None, facet_constraints=None, facet_sort=None, facet_top_n=None, t=None)¶
-
get_all_hits
(query)¶ 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 ( exfm.cloudsearch.Query
) – A fully specified Query instanceReturn type: generator Returns: All docs matching query
-
get_all_paged
(query, per_page)¶ Get a generator to iterate over all pages of search results
Parameters: - query (
exfm.cloudsearch.Query
) – A fully specified Query instance - per_page (int) – Number of docs in each SearchResults object.
Return type: generator
Returns: Generator containing
exfm.cloudsearch.SearchResults
- query (
-
get_num_hits
(query)¶ Return the total number of hits for query
Parameters: query ( exfm.cloudsearch.Query
) – A fully specified Query instanceReturn type: int Returns: Total number of hits for query
-
search
(q=None, bq=None, rank=None, return_fields=None, size=10, start=0, facet=None, facet_constraints=None, facet_sort=None, facet_top_n=None, t=None)¶ Query Cloudsearch
Parameters: - q –
- bq –
- rank –
- return_fields –
- size –
- start –
- facet –
- facet_constraints –
- facet_sort –
- facet_top_n –
- t –
Return type: exfm.cloudsearch.SearchResults
Returns: A cloudsearch SearchResults object
-
-
class
boto.cloudsearch.search.
SearchResults
(**attrs)¶ -
next_page
()¶ Call Cloudsearch to get the next page of search results
Return type: exfm.cloudsearch.SearchResults
Returns: A cloudsearch SearchResults object
-
-
exception
boto.cloudsearch.search.
SearchServiceException
¶
boto.cloudsearch.document¶
-
exception
boto.cloudsearch.document.
CommitMismatchError
¶
-
class
boto.cloudsearch.document.
CommitResponse
(response, doc_service, sdf)¶ Wrapper for response to Cloudsearch document batch commit.
Parameters: - response (
requests.models.Response
) – Response from Cloudsearch /documents/batch API - doc_service (
exfm.cloudsearch.DocumentServiceConnection
) – Object containing the documents posted and methods to retry
Raises: Raises: exfm.cloudsearch.SearchServiceException
- response (
-
class
boto.cloudsearch.document.
DocumentServiceConnection
(domain=None, endpoint=None)¶ -
add
(_id, version, fields, lang='en')¶
-
add_sdf_from_s3
(key_obj)¶ @todo (lucas) would be nice if this could just take an s3://uri...
-
clear_sdf
()¶
-
commit
()¶
-
delete
(_id, version)¶
-
get_sdf
()¶
-
-
exception
boto.cloudsearch.document.
SearchServiceException
¶