hyb
2026-01-07 c7f60dc7e9a36596f0e0d1787bd0cca4e9b57bcb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Ë
 
çúhI0ãó—ddlmZmZmZmZddlmZGd„d«ZGd„d«ZGd„de«Z    Gd    „d
e«Z
Gd „d «Z y )é)ÚListÚOptionalÚTupleÚUnion)ÚDEFAULT_DIALECTc ó—eZdZdZdeddfd„Zdefd„Zd1d„Zd1d„Z            d2d    ed
e    ed e    e
d e    eddf
d „Z de    e e eefde fd„Z                d3de    e de    ede    ede    eddf
d„Z    d4de    e ede    e eddfd„Zdeddfd„Zdeddfd„Zdeddfd„Zd1d„Zdeddfd„Zde e eeeffd„Zde e eeeffd „Zd!ed"eddfd#„Zd1d$„Zd1d%„Zd1d&„Zd1d'„Zd1d(„Zdeddfd)„Z d5d*„Z!d6d    ed+e
ddfd,„Z"d-eddfd.„Z#d/eddfd0„Z$y)7ÚQueryaA
    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ó^—||_d|_d|_d|_d|_d|_d|_d|_d|_d|_    t«|_ d|_ d|_ d|_d|_d|_g|_i|_g|_g|_d|_d|_t.|_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Ú    _expanderrÚ_dialect)Úselfr
s  õnH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\redis/commands/search/query.pyÚ__init__zQuery.__init__s°€ð#/ˆÔ؈Œ ؈Œ    Ø!&ˆÔØ#(ˆÔØ,0ˆŒ Ø$ˆŒØ$)ˆÔØ"'ˆÔØ&*ˆŒ Ü"›fˆŒ Ø/3ˆŒ    ØˆŒ
Ø)-ˆŒ Ø$ˆŒØ.2ˆŒ Ø$&ˆÔØ.0ˆÔ%Ø')ˆÔØ')ˆÔØ(,ˆŒØ(,ˆŒÜ,ˆ ócó—|jS)z+Return the query string of this query only.)r©r's r(r
zQuery.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_idszQuery.limit_ids3s€ðˆŒ    Øˆ r*có6—|D]}|j|«Œ|S)zAdd fields to return fields.)Ú return_field)r'ÚfieldsÚfields   r(Ú return_fieldszQuery.return_fields9s$€àò    %ˆEØ × Ñ ˜eÕ $ð    %àˆ r*r3Úas_fieldÚ decode_fieldÚencodingcó”—|jj|«|r|nd|j|<||xjd|fz 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'r3r5r6r7s     r(r1zQuery.return_field?sM€ð     ×Ñ×"Ñ" 5Ô)Ù;G©xÈTˆ×%Ñ% eÑ,Ø Ð Ø × Ò  D¨(Ð#3Ñ 3Õ Øˆ r*r2cóF—|sgSt|t«r|gSt|«S©N)Ú
isinstanceÚstrr©r'r2s  r(Ú_mk_field_listzQuery._mk_field_listTs$€Ù؈IÜ% f¬cÔ2ˆxÐD¼¸V» ÐDr*Ú context_lenÚ    num_fragsÚsepcóҗdg}|j|«}|r|dtt|««g|zz }||dt|«gz }||dt|«gz }||d|gz }||_|S)a“
        Return an abridged format of the field, containing only the segments of
        the field that 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'r2rArBrCÚargss      r(Ú    summarizezQuery.summarizeYs€ð.ˆ}ˆØ×$Ñ$ VÓ,ˆÙ Ø Xœs¤3 v£;Ó/Ð0°6Ñ9Ñ 9ˆDà Ð "Ø UœC  Ó,Ð-Ñ -ˆDØ Ð  Ø Wœc )›nÐ-Ñ -ˆDØ ˆ?Ø [ #Ð&Ñ &ˆDà!%ˆÔ؈ r*Útagscó —dg}|j|«}|r|dtt|««g|zz }|r|dgt|«zz }||_|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.
        Ú    HIGHLIGHTrFÚTAGS)r@r>rJrr#)r'r2rMrKs    r(Ú    highlightzQuery.highlights`€ðˆ}ˆØ×$Ñ$ 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'rRs  r(rRzQuery.language“ó€ð "ˆŒØˆ r*Úslopcó—||_|S)zpAllow a maximum of N intervening non-matched terms between
        phrase terms (0 means exact phrase).
        )r)r'rUs  r(rUz
Query.slopœs€ðˆŒ
؈ r*Útimeoutcó—||_|S)z-overrides the timeout parameter of the module)r)r'rWs  r(rWz 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)rr,s r(Úin_orderzQuery.in_order¨s€ð ˆŒØˆ r*Úscorercó—||_|S)a
        Use a different scoring function to evaluate document relevance.
        Default is `TFIDF`.
 
        Since Redis 8.0 default was changed to BM25STD.
 
        :param scorer: The scoring function to use
                       (e.g. `TFIDF.DOCNORM` or `BM25`)
        )r)r'r[s  r(r[z Query.scorer±s€ðˆŒ ؈ r*có¶—|jg}||j«z }||j|jzz }|d|j|j
gz }|S)z:Format the redis arguments for this query and return them.ÚLIMIT)rÚ_get_args_tagsr"r#rr)r'rKs  r(Úget_argszQuery.get_args¾s\€à.2×.@Ñ.@Ð-AˆØ ×#Ñ#Ó%Ñ%ˆØ ×&Ñ&¨×)?Ñ)?Ñ?Ñ?ˆØ ˜$Ÿ,™,¨¯    ©    Ð2Ñ2ˆØˆ r*cóì—g}|jr|jd«|jrD|jd«|jt|j««||jz }|jr|jd«|j
r|jd«|j r;|j D],}t|t«s td«‚||jz }Œ.|jr|jd«|jr|d|jgz }|jr|jd«|jrD|jd    «|jt|j««||jz }|jd
k\r|d |jgz }|j |d |j gz }|j"r|jd «|j$rD|jd«|jt|j$««||j$z }|j&rOt|j&t(«s td«‚|jd«||j&jz }|j*r|d|j*gz }|j,r|d|j,gz }|j.r|d|j.gz }|S)NÚ    NOCONTENTÚINFIELDSÚVERBATIMÚ NOSTOPWORDSz Did not receive a Filter object.Ú WITHPAYLOADSÚSCORERÚ
WITHSCORESÚINKEYSrÚSLOPÚTIMEOUTÚINORDERÚRETURNzDid not receive a SortByField.ÚSORTBYÚLANGUAGEÚEXPANDERÚDIALECT)rr:rrJrrrr=ÚFilterÚAttributeErrorrKrrrrrrrr rÚ SortbyFieldr$r%r&)r'rKÚflts   r(r_zQuery._get_args_tagsÆsQ€Ø-/ˆØ × Ò Ø 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
        )rr)r'rvrws   r(Úpagingz Query.pagingùs€ðˆŒ ؈Œ    Øˆ r*có—d|_|S)zXSet the query to be verbatim, i.e., use no query expansion
        or stemming.
        T)rr,s r(ÚverbatimzQuery.verbatims€ðˆŒØˆ r*có—d|_|S)z>Set the query to only return ids and not the document content.T)rr,s r(Ú
no_contentzQuery.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)rr,s r(Ú no_stopwordszQuery.no_stopwordss€ð "ˆÔ؈ r*có—d|_|S)z+Ask the engine to return document payloads.T)rr,s r(Ú with_payloadszQuery.with_payloadss€à"ˆÔ؈ r*có—d|_|S)z0Ask the engine to return document search scores.T)rr,s r(Ú with_scoreszQuery.with_scoress€à ˆÔ؈ r*có&—t|«|_|S)z³
        Limit the search to specific TEXT fields only.
 
        - **fields**: Each element should be a string, case sensitive field name
        from the defined schema.
        )rrr?s  r(Ú limit_fieldszQuery.limit_fields#s€ô˜F“|ˆŒ ؈ r*có<—|jj|«|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
        )rr:)r'rus  r(Ú
add_filterzQuery.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 ascending order
        )rtr©r'r3rˆs   r(Úsort_byz Query.sort_by9s€ô# 5¨#Ó.ˆŒ ؈ r*Úexpandercó—||_|S)zh
        Add an expander field to the query.
 
        - **expander** - the name of the expander
        )r%)r'rŒs  r(rŒzQuery.expanderCrTr*Ú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.dialectLs€ð  ˆŒ ؈ r*)r r    )NTÚutf8)NNNN)NN)rurrr r    ©T)%Ú__name__Ú
__module__Ú __qualname__Ú__doc__r>r)r
r/r4rÚboolr1rrr@ÚintrLrQrRrUÚfloatrWrZr[r`r_ryr{r}rrrƒr…r‡r‹rŒrŽ©r*r(r    r    sC„ñð- Sð-¨Tó-ð>"˜có"óó ð#'Ø'+Ø"(ñ àðð˜3‘-ðð˜t‘nð    ð
˜3‘-ð ð
ó ð*E X¨e°D¸±I¸s°NÑ.CÑ%DðEÈóEð"&Ø%)Ø#'Ø!ñ $à˜‘ð$ð˜c‘]ð$ð˜C‘=ð    $ð
c‰]ð $ð
ó $ðNOSñؘt C™yÑ)ðØ8@ÀÀcÁÑ8Kðà    óð( ð¨óð˜ð óð˜uð¨óó
ð ˜Sð  Wó ð˜$˜u S¨#¨u _Ñ5Ñ6óð1  U¨3°°U¨?Ñ%;Ñ <ó1ðf    ˜Sð     sð    ¨wó    óóó
óó
ð
 Cð¨Góó
ñ˜Sð tð°wóð ð¨óð˜sð wôr*r    có.—eZdZdededeeefddfd„Zy)rrÚkeywordr3rKr Ncó.—||gt|«z|_yr<)rrK)r'r›r3rKs    r(r)zFilter.__init__Ws€Ø˜eÐ$¤t¨D£zÑ1ˆ    r*)r’r“r”r>rr˜r)r™r*r(rrrrVs,„ð2 ð2¨Cð2¸¸cÀ5¸jÑ8Ið2Èdô2r*rrc óN—eZdZdZdZ        d dedeeefdeeefdededd    f d
„Z    y    ) Ú NumericFilterz+infz-infr3ÚminvalÚmaxvalÚ minExclusiveÚ maxExclusiver NcóX—|s|nd|›|s|nd|›g}tj|d|g|¢­Žy)Nú(ÚFILTER©rrr))r'r3rŸr r¡r¢rKs       r(r)zNumericFilter.__init___s<€ñ'‰F¨a°¨x¨LÙ&‰F¨a°¨x¨Lð
ˆô
    ‰˜˜h¨Ð5°Ô5r*)FF)
r’r“r”ÚINFÚNEG_INFr>rr—r–r)r™r*r(ržrž[sc„Ø
€CØ€Gð#Ø"ñ 6àð 6ðc˜3h‘ð 6ðc˜3h‘ð     6ð
ð 6ð ð 6ð
ô 6r*ržc ó@—eZdZdZdZdZdZefdedededed    ed
d f d „Z    y ) Ú    GeoFilterÚmÚkmÚftÚmir3ÚlonÚlatÚradiusÚunitr Nc    ó:—tj|d|||||«y)NÚ    GEOFILTERr¦)r'r3r¯r°r±r²s      r(r)zGeoFilter.__init__us€ô    ‰˜˜k¨5°#°s¸FÀDÕIr*)
r’r“r”ÚMETERSÚ
KILOMETERSÚFEETÚMILESr>r˜r)r™r*r(rªrªosY„Ø €FØ€JØ €DØ €EðNXñJØðJØ$ðJØ+0ðJØ:?ðJØGJðJà     ôJr*rªcó—eZdZddeddfd„Zy)rtr3r Ncó,—||r    dg|_ydg|_y)NÚASCÚDESC)rKrŠs   r(r)zSortbyField.__init__|s€Ø¡S˜EÐ5ˆ    ¨fÐ5ˆ    r*r‘)r’r“r”r>r)r™r*r(rtrt{s„ñ6˜cð6°ô6r*rtN) ÚtypingrrrrÚredis.commands.search.dialectrr    rrržrªrtr™r*r(ú<module>r¿sIðß/Ó/å9÷MñM÷`
2ñ2ô
6Fô6ô(    Jô    J÷6ò6r*