ó FRTc@sŸddlZddlmZddlmZddlmZddlmZddlmZddlm Z ddl m Z d „Z d e fd „ƒYZdS( iÿÿÿÿN(tjson(t OptionStatus(tIndexFieldStatus(tServicePoliciesStatus(tRankExpressionStatus(tDocumentServiceConnection(tSearchConnectioncCs#|tddddgkrtStS(NttruetTruetTRUEi(RtFalse(tvalue((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt handle_bool"stDomaincBsëeZdZd„Zd„Zed„ƒZed„ƒZed„ƒZed„ƒZ ed„ƒZ e j d„ƒZ ed „ƒZ e j d „ƒZ ed „ƒZ e j d „ƒZ ed „ƒZej d„ƒZed„ƒZej d„ƒZed„ƒZej d„ƒZed„ƒZej d„ƒZed„ƒZed„ƒZd„Zd„Zd„Zd„Zd„Zd„Zd%d„Zdeeegd„Zd%d „Zd!„Zd"„Z d#„Z!d$„Z"RS(&sÐ A Cloudsearch domain. :ivar name: The name of the domain. :ivar id: The internally generated unique identifier for the domain. :ivar 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 :ivar 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. :ivar processing: True if processing is being done to activate the current domain configuration. :ivar num_searchable_docs: The number of documents that have been submittted to the domain and indexed. :ivar requires_index_document: True if index_documents needs to be called to activate the current domain configuration. :ivar search_instance_count: The number of search instances that are available to process search requests. :ivar search_instance_type: The instance type that is being used to process search requests. :ivar search_partition_count: The number of partitions across which the search index is spread. cCs||_|j|ƒdS(N(tlayer1tupdate_from_data(tselfRtdata((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt__init__Ps cCs¨|d|_|d|_|d|_|d|_|d|_|d|_|d|_|d|_|jd dƒ|_ |d |_ |d |_ |d |_ dS( Ntcreatedtdeletedt processingtrequires_index_documentst domain_idt domain_nametnum_searchable_docstsearch_instance_counttsearch_instance_typetsearch_partition_countt doc_servicetsearch_service(RRRRRRRRtgettNoneRRt _doc_servicet_search_service(RR((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRTs          cCs |jdS(Ntarn(R!(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytdoc_service_arnbscCs |jdS(Ntendpoint(R!(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytdoc_service_endpointfscCs |jdS(NR#(R"(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytsearch_service_arnjscCs |jdS(NR%(R"(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytsearch_service_endpointnscCs|jS(N(t_created(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRrscCst|ƒ|_dS(N(R R)(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRvscCs|jS(N(t_deleted(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRzscCst|ƒ|_dS(N(R R*(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR~scCs|jS(N(t _processing(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR‚scCst|ƒ|_dS(N(R R+(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR†scCs|jS(N(t_requires_index_documents(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRŠscCst|ƒ|_dS(N(R R,(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRŽscCs|jS(N(t_search_partition_count(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR’scCst|ƒ|_dS(N(tintR-(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR–scCs|jS(N(t_search_instance_count(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRšscCst|ƒ|_dS(N(R.R/(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRžscCs|jS(N(t_num_searchable_docs(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR¢scCst|ƒ|_dS(N(R.R0(RR ((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR¦scCs|jS(N(R(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytnameªscCs|jS(N(R(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytid®scCs|jj|jƒS(sK Delete this domain and all index data associated with it. (Rt delete_domainR1(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytdelete²scCst|d|jj|jjƒS(s£ Return a :class:`boto.cloudsearch.option.OptionStatus` object representing the currently defined stemming options for the domain. N(RR Rtdescribe_stemming_optionstupdate_stemming_options(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt get_stemming¸s  cCst|d|jj|jjƒS(s£ Return a :class:`boto.cloudsearch.option.OptionStatus` object representing the currently defined stopword options for the domain. N(RR Rtdescribe_stopword_optionstupdate_stopword_options(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt get_stopwordsÂs  cCst|d|jj|jjƒS(s¢ Return a :class:`boto.cloudsearch.option.OptionStatus` object representing the currently defined synonym options for the domain. N(RR Rtdescribe_synonym_optionstupdate_synonym_options(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt get_synonymsÌs  cCst|d|jj|jjƒS(s¢ Return a :class:`boto.cloudsearch.option.OptionStatus` object representing the currently defined access policies for the domain. N(RR Rt describe_service_access_policiestupdate_service_access_policies(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytget_access_policiesÖs  cCs|jj|jƒdS(s) 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. N(Rtindex_documentsR1(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyRAàscCs8|jj|j|ƒ}g|D]}t||ƒ^qS(sH Return a list of index fields defined for this domain. (Rtdescribe_index_fieldsR1R(Rt field_namesRtd((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytget_index_fieldsêstc CsO|jj|j||d|d|d|d|d|ƒ}t|||jjƒS(s Defines an ``IndexField``, either replacing an existing definition or creating a new one. :type field_name: string :param field_name: The name of a field in the search index. :type field_type: string :param field_type: The type of field. Valid values are uint | literal | text :type default: string or int :param default: The default value for the field. If the field is of type ``uint`` this should be an integer value. Otherwise, it's a string. :type facet: bool :param facet: A boolean to indicate whether facets are enabled for this field or not. Does not apply to fields of type ``uint``. :type results: bool :param results: 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``. :type searchable: bool :param searchable: A boolean to indicate whether search is enabled for this field or not. Applies only to fields of type ``literal``. :type source_attributes: list of dicts :param source_attributes: 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 an ``IndexField`` 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 tdefaulttfacettresultt searchabletsource_attributes(Rtdefine_index_fieldR1RRB( Rt field_namet field_typeRGRHRIRJRKR((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytcreate_index_fieldñsE    cCsA|jj}||j|ƒ}g|D]}t|||ƒ^q%S(sL Return a list of rank expressions defined for this domain. (Rtdescribe_rank_expressionsR1R(Rt rank_namestfnRRD((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytget_rank_expressions>s cCs1|jj|j||ƒ}t|||jjƒS(sœ Create a new rank expression. :type rank_name: string :param rank_name: The name of an expression computed for ranking while processing a search request. :type rank_expression: string :param rank_expression: 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 (Rtdefine_rank_expressionR1RRP(RR1t expressionR((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytcreate_rank_expressionFs8 cCs td|ƒS(Ntdomain(R(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytget_document_service‚scCs td|ƒS(NRW(R(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pytget_search_service…scCs d|jS(Ns (R(R((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyt__repr__ˆsN(#t__name__t __module__t__doc__RRtpropertyR$R&R'R(RtsetterRRRRRRR1R2R4R7R:R=R@RAR RER RORSRVRXRYRZ(((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyR (sJ&      K  <  (tbotot boto.compatRtboto.cloudsearch.optionstatusRRRRtboto.cloudsearch.documentRtboto.cloudsearch.searchRR tobjectR (((sD/opt/freeware/lib/python2.7/site-packages/boto/cloudsearch/domain.pyts