HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/redis/commands/search/__pycache__/field.cpython-39.pyc
a

��b��@szddlmZddlmZGdd�d�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�Z	dS)�)�List)�	DataErrorc@s\eZdZdZdZdZdZdZdZdZ	dZ
d	Zdee
eeeed�d
d�Zdd�Zdd�Zd
S)�Field�NUMERIC�TEXT�WEIGHT�GEO�TAG�VECTOR�SORTABLE�NOINDEX�ASNF)�name�args�sortable�no_index�as_namecCs^|durg}||_||_t�|_||_|r8|j�tj�|rJ|j�tj�|rZ|sZt	d��dS)Nz-Non-Sortable non-Indexable fields are ignored)
rr�list�args_suffixr�appendrrr�
ValueError)�selfrrrrr�r�?/usr/lib/python3.9/site-packages/redis/commands/search/field.py�__init__szField.__init__cCs|j�|�dS�N)rr)r�valuerrr�
append_arg)szField.append_argcCs6|jg}|jr||j|jg7}||j7}||j7}|Sr)rrr
rr)rrrrr�
redis_args,s

zField.redis_args)NFFN)�__name__�
__module__�__qualname__rrrrr	r
rrr
�strr�boolrrrrrrrrs,��rc@s.eZdZdZdZdZd
eeeed�dd	�Z	dS)�	TextFieldzI
    TextField is used to define a text field in a schema definition
    �NOSTEM�PHONETIC��?FN)r�weight�no_stem�phonetic_matchercKs^tj||fdtjtj|gi|��|r4t�||j�|rZ|dvrZt�||j�t�||�dS)Nr)zdm:enzdm:frzdm:ptzdm:es)rrrrrr%r&)rrr(r)r*�kwargsrrrr=s"zTextField.__init__)r'FN)
rr r!�__doc__r%r&r"�floatr#rrrrrr$5s��r$c@seZdZdZed�dd�ZdS)�NumericFieldzO
    NumericField is used to define a numeric field in a schema definition
    �rcKs tj||fdtjgi|��dS�Nr)rrr�rrr+rrrrXszNumericField.__init__N�rr r!r,r"rrrrrr.Ssr.c@seZdZdZed�dd�ZdS)�GeoFieldzP
    GeoField is used to define a geo-indexing field in a schema definition
    r/cKs tj||fdtjgi|��dSr0)rrrr1rrrraszGeoField.__init__Nr2rrrrr3\sr3c@s,eZdZdZdZdZd
eeed�dd�Zd	S)�TagFieldzx
    TagField is a tag-indexing field with simpler compression and tokenization.
    See http://redisearch.io/Tags/
    �	SEPARATOR�
CASESENSITIVE�,F)r�	separator�case_sensitivecKs:tj|j|g}|r|�|j�tj||fd|i|��dSr0)rr	r5rr6r)rrr8r9r+rrrrrnszTagField.__init__N)r7F)	rr r!r,r5r6r"r#rrrrrr4es��r4c@s"eZdZdZeeed�dd�ZdS)�VectorFieldz�
    Allows vector similarity queries against the value in this attribute.
    See https://oss.redis.com/redisearch/Vectors/#vector_fields.
    )r�	algorithm�
attributesc
Ks�|�dd�}|�dd�}|s |r(td��|��dvr<td��g}|��D]\}}	|�||	g�qHtj||fdtj|t|�g|�i|��dS)	a�
        Create Vector Field. Notice that Vector cannot have sortable or no_index tag,
        although it's also a Field.

        ``name`` is the name of the field.

        ``algorithm`` can be "FLAT" or "HNSW".

        ``attributes`` each algorithm can have specific attributes. Some of them
        are mandatory and some of them are optional. See
        https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm
        for more information.
        rFrz5Cannot set 'sortable' or 'no_index' in Vector fields.)ZFLATZHNSWzIRealtime vector indexing supporting 2 Indexing Methods:'FLAT' and 'HNSW'.rN)	�getr�upper�items�extendrrr
�len)
rrr;r<r+�sortZnoindexZattr_li�keyrrrrr~s$����zVectorField.__init__N)rr r!r,r"�dictrrrrrr:xsr:N)
�typingrZredisrrr$r.r3r4r:rrrr�<module>s/