Ë
    êU.j2/  ã                   ó€   — d dl mZmZmZ  G d„ d«      Z G d„ d«      Z G d„ de«      Z G d„ d	e«      Z G d
„ d«      Zy)é    )ÚListÚOptionalÚUnionc                   óò  — e Zd ZdZdeddfd„Zdefd„Zd1d„Zd1d„Z	 	 	 d2d	ed
e	e   de	e
   de	e   dd f
d„Zdee   defd„Z	 	 	 	 d3de	e   de	e   de	e   de	e   dd f
d„Z	 d4de	ee      de	ee      ddfd„Zdedd fd„Zdedd fd„Zdedd fd„Zd1d„Zdedd fd„Zdee   fd„Zdee   fd „Zd!ed"edd fd#„Zd1d$„Zd1d%„Zd1d&„Zd1d'„Zd1d(„Zdee   dd fd)„Zd5d*„Z d6d	ed+e
dd fd,„Z!d-edd fd.„Z"d/edd fd0„Z#y)7ÚQueryaB  
    Query is used to build complex queries that have more parameters than just
    the query string. The query string is set in the constructor, and other
    options have setter functions.

    The setter functions return the query object, so they can be chained,
    i.e. `Query("foo").verbatim().filter(...)` etc.
    Úquery_stringÚreturnNc                 óV  — || _         d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _	        t        «       | _        d| _        d| _        d| _        d| _        d| _        g | _        i | _        g | _        g | _        d| _        d| _        d| _        y)z‘
        Create a new query object.
        The query string is set in the constructor, and other options have
        setter functions.
        r   é
   FNéÿÿÿÿ)Ú_query_stringÚ_offsetÚ_numÚ_no_contentÚ_no_stopwordsÚ_fieldsÚ	_verbatimÚ_with_payloadsÚ_with_scoresÚ_scorerÚlistÚ_filtersÚ_idsÚ_slopÚ_timeoutÚ	_in_orderÚ_sortbyÚ_return_fieldsÚ_return_fields_decode_asÚ_summarize_fieldsÚ_highlight_fieldsÚ	_languageÚ	_expanderÚ_dialect)Úselfr   s     ú]C:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\redis/commands/search/query.pyÚ__init__zQuery.__init__   s°   € ð #/ˆÔØˆŒØˆŒ	Ø!&ˆÔØ#(ˆÔØ,0ˆŒØ$ˆŒØ$)ˆÔØ"'ˆÔØ&*ˆŒÜ"›fˆŒØ)-ˆŒ	ØˆŒ
Ø)-ˆŒØ$ˆŒØ.2ˆŒØ$&ˆÔØ.0ˆÔ%Ø')ˆÔØ')ˆÔØ(,ˆŒØ(,ˆŒØ'+ˆ�ó    c                 ó   — | j                   S )z+Return the query string of this query only.)r   ©r%   s    r&   r   zQuery.query_string-   s   € à×!Ñ!Ð!r(   c                 ó   — || _         | S )zTLimit the results to a specific set of pre-known document
        ids of any length.)r   )r%   Úidss     r&   Ú	limit_idszQuery.limit_ids1   s   € ð ˆŒ	Øˆr(   c                 ó6   — |D ]  }| j                  |«       Œ | S )zAdd fields to return fields.)Úreturn_field)r%   ÚfieldsÚfields      r&   Úreturn_fieldszQuery.return_fields7   s   € ãˆEØ×Ñ˜eÕ$ð àˆr(   r1   Úas_fieldÚdecode_fieldÚencodingc                 ó”   — | j                   j                  |«       |r|nd| j                  |<   |�| xj                   d|fz  c_         | S )a;  
        Add a field to the list of fields to return.

        - **field**: The field to include in query results
        - **as_field**: The alias for the field
        - **decode_field**: Whether to decode the field from bytes to string
        - **encoding**: The encoding to use when decoding the field
        NÚAS)r   Úappendr   )r%   r1   r3   r4   r5   s        r&   r/   zQuery.return_field=   sM   € ð 	×Ñ×"Ñ" 5Ô)Ù;G©xÈTˆ×%Ñ% eÑ,ØÐØ×Ò D¨(Ð#3Ñ3ÕØˆr(   r0   c                 óF   — |sg S t        |t        «      r|gS t        |«      S ©N)Ú
isinstanceÚstrr   ©r%   r0   s     r&   Ú_mk_field_listzQuery._mk_field_listR   s$   € ÙØˆIÜ% f¬cÔ2�ˆxÐD¼¸V»ÐDr(   Úcontext_lenÚ	num_fragsÚsepc                 óÒ   — dg}| j                  |«      }|r|dt        t        |«      «      g|z   z  }|�|dt        |«      gz  }|�|dt        |«      gz  }|�|d|gz  }|| _        | S )a“  
        Return an abridged format of the field, containing only the segments of
        the field which contain the matching term(s).

        If `fields` is specified, then only the mentioned fields are
        summarized; otherwise all results are summarized.

        Server side defaults are used for each option (except `fields`)
        if not specified

        - **fields** List of fields to summarize. All fields are summarized
        if not specified
        - **context_len** Amount of context to include with each fragment
        - **num_frags** Number of fragments per document
        - **sep** Separator string to separate fragments
        Ú	SUMMARIZEÚFIELDSÚLENÚFRAGSÚ	SEPARATOR)r>   r<   Úlenr    )r%   r0   r?   r@   rA   Úargss         r&   Ú	summarizezQuery.summarizeW   s�   € ð. ˆ}ˆØ×$Ñ$ VÓ,ˆÙØ�Xœs¤3 v£;Ó/Ð0°6Ñ9Ñ9ˆDàÐ"Ø�UœC Ó,Ð-Ñ-ˆDØÐ Ø�Wœc )›nÐ-Ñ-ˆDØˆ?Ø�[ #Ð&Ñ&ˆDà!%ˆÔØˆr(   Útagsc                 ó    — dg}| j                  |«      }|r|dt        t        |«      «      g|z   z  }|r|dgt        |«      z   z  }|| _        | S )a  
        Apply specified markup to matched term(s) within the returned field(s).

        - **fields** If specified then only those mentioned fields are
        highlighted, otherwise all fields are highlighted
        - **tags** A list of two strings to surround the match.
        Ú	HIGHLIGHTrD   ÚTAGS)r>   r<   rH   r   r!   )r%   r0   rK   rI   s       r&   Ú	highlightzQuery.highlight}   s`   € ð ˆ}ˆØ×$Ñ$ VÓ,ˆÙØ�Xœs¤3 v£;Ó/Ð0°6Ñ9Ñ9ˆDÙØ�V�Hœt D›zÑ)Ñ)ˆDà!%ˆÔØˆr(   Úlanguagec                 ó   — || _         | S )zŒ
        Analyze the query as being in the specified language.

        :param language: The language (e.g. `chinese` or `english`)
        )r"   )r%   rP   s     r&   rP   zQuery.language‘   ó   € ð "ˆŒØˆr(   Úslopc                 ó   — || _         | S )zpAllow a maximum of N intervening non matched terms between
        phrase terms (0 means exact phrase).
        )r   )r%   rS   s     r&   rS   z
Query.slopš   s   € ð ˆŒ
Øˆr(   Útimeoutc                 ó   — || _         | S )z-overrides the timeout parameter of the module)r   )r%   rU   s     r&   rU   zQuery.timeout¡   s   € àˆŒØˆr(   c                 ó   — d| _         | S )z¶
        Match only documents where the query terms appear in
        the same order in the document.
        i.e. for the query "hello world", we do not match "world hello"
        T)r   r*   s    r&   Úin_orderzQuery.in_order¦   s   € ð ˆŒØˆr(   Úscorerc                 ó   — || _         | S )zÚ
        Use a different scoring function to evaluate document relevance.
        Default is `TFIDF`.

        :param scorer: The scoring function to use
                       (e.g. `TFIDF.DOCNORM` or `BM25`)
        )r   )r%   rY   s     r&   rY   zQuery.scorer¯   s   € ð ˆŒØˆr(   c                 ó¶   — | j                   g}|| j                  «       z  }|| j                  | j                  z   z  }|d| j                  | j
                  gz  }|S )z:Format the redis arguments for this query and return them.ÚLIMIT)r   Ú_get_args_tagsr    r!   r   r   )r%   rI   s     r&   Úget_argszQuery.get_argsº   s\   € à×"Ñ"Ð#ˆØ�×#Ñ#Ó%Ñ%ˆØ�×&Ñ&¨×)?Ñ)?Ñ?Ñ?ˆØ�˜$Ÿ,™,¨¯	©	Ð2Ñ2ˆØˆr(   c                 óì  — g }| j                   r|j                  d«       | j                  rD|j                  d«       |j                  t        | j                  «      «       || j                  z  }| j                  r|j                  d«       | j
                  r|j                  d«       | j                  r;| j                  D ],  }t        |t        «      st        d«      ‚||j                  z  }Œ. | j                  r|j                  d«       | j                  r|d| j                  gz  }| j                  r|j                  d«       | j                  rD|j                  d	«       |j                  t        | j                  «      «       || j                  z  }| j                  d
k\  r|d| j                  gz  }| j                   �|d| j                   gz  }| j"                  r|j                  d«       | j$                  rD|j                  d«       |j                  t        | j$                  «      «       || j$                  z  }| j&                  rOt        | j&                  t(        «      st        d«      ‚|j                  d«       || j&                  j                  z  }| j*                  r|d| j*                  gz  }| j,                  r|d| j,                  gz  }| j.                  r|d| j.                  gz  }|S )NÚ	NOCONTENTÚINFIELDSÚVERBATIMÚNOSTOPWORDSz Did not receive a Filter object.ÚWITHPAYLOADSÚSCORERÚ
WITHSCORESÚINKEYSr   ÚSLOPÚTIMEOUTÚINORDERÚRETURNzDid not receive a SortByField.ÚSORTBYÚLANGUAGEÚEXPANDERÚDIALECT)r   r8   r   rH   r   r   r   r;   ÚFilterÚAttributeErrorrI   r   r   r   r   r   r   r   r   r   ÚSortbyFieldr"   r#   r$   )r%   rI   Úflts      r&   r]   zQuery._get_args_tagsÂ   sL  € ØˆØ×ÒØ�K‰K˜Ô$Ø�<Š<Ø�K‰K˜
Ô#Ø�K‰Kœ˜DŸL™LÓ)Ô*Ø�D—L‘LÑ ˆDØ�>Š>Ø�K‰K˜
Ô#Ø×ÒØ�K‰K˜Ô&Ø�=Š=Ø—}”}�Ü! #¤vÔ.Ü(Ð)KÓLÐLØ˜Ÿ™Ñ ‘ð %ð ×ÒØ�K‰K˜Ô'Ø�<Š<Ø�X˜tŸ|™|Ð,Ñ,ˆDØ×ÒØ�K‰K˜Ô%Ø�9Š9Ø�K‰K˜Ô!Ø�K‰Kœ˜DŸI™I›Ô'Ø�D—I‘IÑˆDØ�:‰:˜Š?Ø�V˜TŸZ™ZÐ(Ñ(ˆDØ�=‰=Ð$Ø�Y §¡Ð.Ñ.ˆDØ�>Š>Ø�K‰K˜	Ô"Ø×ÒØ�K‰K˜Ô!Ø�K‰Kœ˜D×/Ñ/Ó0Ô1Ø�D×'Ñ'Ñ'ˆDØ�<Š<Ü˜dŸl™l¬KÔ8Ü$Ð%EÓFÐFØ�K‰K˜Ô!Ø�D—L‘L×%Ñ%Ñ%ˆDØ�>Š>Ø�Z §¡Ð0Ñ0ˆDØ�>Š>Ø�Z §¡Ð0Ñ0ˆDØ�=Š=Ø�Y §¡Ð.Ñ.ˆDàˆr(   ÚoffsetÚnumc                 ó"   — || _         || _        | S )z¶
        Set the paging for the query (defaults to 0..10).

        - **offset**: Paging offset for the results. Defaults to 0
        - **num**: How many results do we want
        )r   r   )r%   rt   ru   s      r&   ÚpagingzQuery.pagingõ   s   € ð ˆŒØˆŒ	Øˆr(   c                 ó   — d| _         | S )zWSet the query to be verbatim, i.e. use no query expansion
        or stemming.
        T)r   r*   s    r&   ÚverbatimzQuery.verbatim   s   € ð ˆŒØˆr(   c                 ó   — d| _         | S )z>Set the query to only return ids and not the document content.T)r   r*   s    r&   Ú
no_contentzQuery.no_content  s   € àˆÔØˆr(   c                 ó   — d| _         | S )z¡
        Prevent the query from being filtered for stopwords.
        Only useful in very big queries that you are certain contain
        no stopwords.
        T)r   r*   s    r&   Úno_stopwordszQuery.no_stopwords  s   € ð "ˆÔØˆr(   c                 ó   — d| _         | S )z+Ask the engine to return document payloads.T)r   r*   s    r&   Úwith_payloadszQuery.with_payloads  s   € à"ˆÔØˆr(   c                 ó   — d| _         | S )z0Ask the engine to return document search scores.T)r   r*   s    r&   Úwith_scoreszQuery.with_scores  s   € à ˆÔØˆr(   c                 ó   — || _         | S )z¦
        Limit the search to specific TEXT fields only.

        - **fields**: A list of strings, case sensitive field names
        from the defined schema.
        )r   r=   s     r&   Úlimit_fieldszQuery.limit_fields  s   € ð ˆŒØˆr(   c                 ó<   — | j                   j                  |«       | S )zã
        Add a numeric or geo filter to the query.
        **Currently only one of each filter is supported by the engine**

        - **flt**: A NumericFilter or GeoFilter object, used on a
        corresponding field
        )r   r8   )r%   rs   s     r&   Ú
add_filterzQuery.add_filter)  s   € ð 	�‰×Ñ˜SÔ!Øˆr(   Úascc                 ó(   — t        ||«      | _        | S )z²
        Add a sortby field to the query.

        - **field** - the name of the field to sort by
        - **asc** - when `True`, sorting will be done in asceding order
        )rr   r   ©r%   r1   r†   s      r&   Úsort_byzQuery.sort_by5  s   € ô # 5¨#Ó.ˆŒØˆr(   Úexpanderc                 ó   — || _         | S )zg
        Add a expander field to the query.

        - **expander** - the name of the expander
        )r#   )r%   rŠ   s     r&   rŠ   zQuery.expander?  rR   r(   Údialectc                 ó   — || _         | S )zw
        Add a dialect field to the query.

        - **dialect** - dialect version to execute the query under
        )r$   )r%   rŒ   s     r&   rŒ   zQuery.dialectH  s   € ð  ˆŒØˆr(   )r	   r   )NTÚutf8)NNNN)NN)rs   rp   r	   r   ©T)$Ú__name__Ú
__module__Ú__qualname__Ú__doc__r<   r'   r   r-   r2   r   Úboolr/   r   r>   ÚintrJ   rO   rP   rS   ÚfloatrU   rX   rY   r^   r]   rw   ry   r{   r}   r   r�   rƒ   r…   r‰   rŠ   rŒ   © r(   r&   r   r      s!  „ ñð, Sð ,¨Tó ,ð>"˜có "óóð #'Ø'+Ø"(ñàðð ˜3‘-ðð ˜t‘nð	ð
 ˜3‘-ðð 
óð*E T¨#¡Yð E°4ó Eð "&Ø%)Ø#'Ø!ñ$à˜‘ð$ð ˜c‘]ð$ð ˜C‘=ð	$ð
 �c‰]ð$ð 
ó$ðN OSñØ˜t C™yÑ)ðØ8@ÀÀcÁÑ8Kðà	óð( ð ¨ó ð˜ð  ó ð˜uð ¨ó ó
ð	˜Sð 	 Wó 	ð˜$˜s™)ó ð1  S¡	ó 1ðf	˜Sð 	 sð 	¨wó 	óóó
óó
ð
 D¨¡Ið °'ó ó
ñ˜Sð  tð °wó ð ð ¨ó ð˜sð  wô r(   r   c                   ó*   — e Zd Zdededee   ddfd„Zy)rp   Úkeywordr1   rI   r	   Nc                 ó.   — ||gt        |«      z   | _        y r:   )r   rI   )r%   r™   r1   rI   s       r&   r'   zFilter.__init__S  s   € Ø˜eÐ$¤t¨D£zÑ1ˆ�	r(   )r�   r‘   r’   r<   r   r'   r—   r(   r&   rp   rp   R  s'   „ ð2 ð 2¨Cð 2¸¸S¹	ð 2Àdô 2r(   rp   c                   óN   — e Zd ZdZdZ	 	 ddedeeef   deeef   dededd	fd
„Z	y	)ÚNumericFilterz+infz-infr1   ÚminvalÚmaxvalÚminExclusiveÚmaxExclusiver	   Nc                 óX   — |s|nd|› �|s|nd|› �g}t        j                  | d|g|¢­Ž  y )NÚ(ÚFILTER©rp   r'   )r%   r1   r�   rž   rŸ   r    rI   s          r&   r'   zNumericFilter.__init__[  s<   € ñ '‰F¨a°¨x¨LÙ&‰F¨a°¨x¨Lð
ˆô
 	�‰˜˜h¨Ð5°Ô5r(   )FF)
r�   r‘   r’   ÚINFÚNEG_INFr<   r   r•   r”   r'   r—   r(   r&   rœ   rœ   W  sc   „ Ø
€CØ€Gð #Ø"ñ6àð6ð �c˜3�h‘ð6ð �c˜3�h‘ð	6ð
 ð6ð ð6ð 
ô6r(   rœ   c                   ó@   — e Zd ZdZdZdZdZefdedededed	ed
dfd„Z	y)Ú	GeoFilterÚmÚkmÚftÚmir1   ÚlonÚlatÚradiusÚunitr	   Nc           	      ó:   — t         j                  | d|||||«       y )NÚ	GEOFILTERr¤   )r%   r1   r­   r®   r¯   r°   s         r&   r'   zGeoFilter.__init__q  s   € ô 	�‰˜˜k¨5°#°s¸FÀDÕIr(   )
r�   r‘   r’   ÚMETERSÚ
KILOMETERSÚFEETÚMILESr<   r–   r'   r—   r(   r&   r¨   r¨   k  sY   „ Ø€FØ€JØ€DØ€Eð NXñJØðJØ$ðJØ+0ðJØ:?ðJØGJðJà	ôJr(   r¨   c                   ó   — e Zd Zddeddfd„Zy)rr   r1   r	   Nc                 ó,   — ||r	dg| _         y dg| _         y )NÚASCÚDESC)rI   rˆ   s      r&   r'   zSortbyField.__init__x  s   € Ø¡S˜EÐ5ˆ�	¨fÐ5ˆ�	r(   r�   )r�   r‘   r’   r<   r'   r—   r(   r&   rr   rr   w  s   „ ñ6˜cð 6°ô 6r(   rr   N)	Útypingr   r   r   r   rp   rœ   r¨   rr   r—   r(   r&   Ú<module>r¼      sF   ðß (Ñ (÷Kñ K÷\
2ñ 2ô
6�Fô 6ô(	J�ô 	J÷6ò 6r(   