
    ng\j]
                     F    S SK Jr  SSKJr   " S S\5      r " S S5      rg)	    )Enum   )list_or_argsc                        \ rS rSrSrSrSrSrg)	IndexType   z,Enum of the currently supported index types.   r    N)__name__
__module____qualname____firstlineno____doc__HASHJSON__static_attributes__r
       a/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/redis/commands/search/index_definition.pyr   r      s    6DDr   r   c                   V    \ rS rSrSr/ SSSSSSS4S jrS rS rS rS	 r	S
 r
S rSrg)IndexDefinition   zcIndexDefinition is used to define a index definition for automatic
indexing on Hash or Json update.Ng      ?c	                     / U l         U R                  U5        U R                  U5        U R                  U5        U R	                  X45        U R                  XV5        U R                  U5        g )N)args_append_index_type_append_prefix_append_filter_append_language_append_score_append_payload)	selfprefixfilterlanguage_fieldlanguagescore_fieldscorepayload_field
index_types	            r   __init__IndexDefinition.__init__   s_     	
+F#F#n7;.]+r   c                    U[         R                  L a  U R                  R                  SS/5        gU[         R                  L a  U R                  R                  SS/5        gUb  [        S[        [         5       35      eg)z4Append `ON HASH` or `ON JSON` according to the enum.ONr   r   Nzindex_type must be one of )r   r   r   extendr   RuntimeErrorlist)r    r(   s     r   r   "IndexDefinition._append_index_type$   si    'IIdF^,9>>)IIdF^,#!;DO;LMNN $r   c                    Uc  [        S5      e[        U5      S:  ap  [        U/ 5      nU R                  R	                  S5        U R                  R	                  [        U5      5        U H  nU R                  R	                  U5        M      gg)zAppend PREFIX.Nzprefix must be providedr   PREFIX)	TypeErrorlenr   r   append)r    r!   ps      r   r   IndexDefinition._append_prefix-   ss    >566v;?!&"-FIIX&IIS[)		  # 	 r   c                 x    Ub7  U R                   R                  S5        U R                   R                  U5        gg)zAppend FILTER.NFILTERr   r5   )r    r"   s     r   r   IndexDefinition._append_filter8   s1    IIX&IIV$ r   c                     Ub6  U R                   R                  S5        U R                   R                  U5        Ub7  U R                   R                  S5        U R                   R                  U5        gg)z#Append LANGUAGE_FIELD and LANGUAGE.NLANGUAGE_FIELDLANGUAGEr:   )r    r#   r$   s      r   r    IndexDefinition._append_language>   s\    %II-.II^,IIZ(IIX&  r   c                     Ub6  U R                   R                  S5        U R                   R                  U5        Ub7  U R                   R                  S5        U R                   R                  U5        gg)zAppend SCORE_FIELD and SCORE.NSCORE_FIELDSCOREr:   )r    r%   r&   s      r   r   IndexDefinition._append_scoreG   s[    "II]+II[)IIW%IIU# r   c                 x    Ub7  U R                   R                  S5        U R                   R                  U5        gg)zAppend PAYLOAD_FIELD.NPAYLOAD_FIELDr:   )r    r'   s     r   r   IndexDefinition._append_payloadP   s1    $II_-II]+ %r   )r   )r   r   r   r   r   r)   r   r   r   r   r   r   r   r
   r   r   r   r      sE    (
 ,&O	$%'$,r   r   N)enumr   helpersr   r   r   r
   r   r   <module>rI      s#     " G, G,r   