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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Ë
 
çúh:-ãóڗddlmZmZmZmZddlmZe«ZGd„d«Z    Gd„d«Z
Gd„d«Z Gd    „d
e «Z Gd „d e «Z Gd „d«ZGd„d«ZGd„d«Zy)é)ÚListÚOptionalÚTupleÚUnion)ÚDEFAULT_DIALECTcó(—eZdZddededdfd„Zd„Zy)ÚLimitÚoffsetÚcountÚreturnNcó —||_||_y©N)r
r )Úselfr
r s   õtH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\redis/commands/search/aggregation.pyÚ__init__zLimit.__init__    s€ØˆŒ ؈
ócót—|jr+dt|j«t|j«gSgS)NÚLIMIT)r Ústrr
©rs rÚ
build_argszLimit.build_args s,€Ø :Š:ØœS §¡Ó-¬s°4·:±:«Ð?Ð ?àˆIr)rr©Ú__name__Ú
__module__Ú __qualname__Úintrr©rrr    r    s!„ñ˜sð¨sð¸4óórr    cóT—eZdZdZdZdeddfd„Zdeddfd„Zede    edffd    „«Z
y)
ÚReducerzr
    Base reducer object for all reducers.
 
    See the `redisearch.reducers` module for the actual reducers.
    NÚargsr có.—||_d|_d|_yr)Ú_argsÚ_fieldÚ_alias©rr s  rrzReducer.__init__s€Ø&*ˆŒ
Ø%)ˆŒ Ø%)ˆ rÚaliascóp—|tur&|js td«‚|jdd}||_|S)a
        Set the alias for this reducer.
 
        ### Parameters
 
        - **alias**: The value of the alias for this reducer. If this is the
            special value `aggregation.FIELDNAME` then this reducer will be
            aliased using the same name as the field upon which it operates.
            Note that using `FIELDNAME` is only possible on reducers which
            operate on a single field value.
 
        This method returns the `Reducer` object making it suitable for
        chaining.
        z(Cannot use FIELDNAME alias with no fieldéN)Ú    FIELDNAMEr#Ú
ValueErrorr$)rr&s  rr&z Reducer.alias"s<€ð ”IÑ Ø—;’;Ü Ð!KÓLÐL🠙  A B˜ØˆŒ ؈ r.có—|jSr)r"rs rr z Reducer.args:s €àz‰zÐr) rrrÚ__doc__ÚNAMErrr&Úpropertyrr rrrrrsW„ñð €Dð*˜cð* dó*ð
˜3ð 9óð0ðe˜C ˜H‘oòóñrrcó6—eZdZUdZdZeeed<deddfd„Zy)Ú SortDirectionz@
    This special class is used to indicate sort direction.
    NÚ    DIRSTRINGÚfieldr có—||_yr)r2)rr2s  rrzSortDirection.__init__Fs    €Øˆ
r)    rrrr,r1rrÚ__annotations__rrrrr0r0?s*…ñð $€Iˆx˜‰}Ó#ð˜cð dôrr0có—eZdZdZdZy)ÚAsczK
    Indicate that the given field should be sorted in ascending order
    ÚASCN©rrrr,r1rrrr6r6Js„ñðIrr6có—eZdZdZdZy)ÚDesczL
    Indicate that the given field should be sorted in descending order
    ÚDESCNr8rrrr:r:Rs„ñðIrr:có—eZdZdZddeddfd„Zdeddfd„Zdeeeefde    ddfd    „Z
dd
„Z d e d e ddfd „Z deddfd„Zdeeeefddfd„Zdd„Zdd„Zdeddfd„Zdd„Zdde deddfd„Zdeefd„Zde ddfd„Zy)ÚAggregateRequestzH
    Aggregation request which can be passed to `Client.aggregate`.
    Úqueryr Ncó¦—||_g|_g|_d|_d|_d|_d|_g|_t|_    d|_
d|_ y)a}
        Create an aggregation request. This request may then be passed to
        `client.aggregate()`.
 
        In order for the request to be usable, it must contain at least one
        group.
 
        - **query** Query string for filtering records.
 
        All member methods (except `build_args()`)
        return the object itself, making them useful for chaining.
        FrÚTFIDFN) Ú_queryÚ_aggregateplanÚ _loadfieldsÚ_loadallÚ_maxÚ _with_schemaÚ    _verbatimÚ_cursorrÚ_dialectÚ _add_scoresÚ_scorer)rr>s  rrzAggregateRequest.__init___sU€ð!ˆŒ Ø)+ˆÔØ&(ˆÔØ#ˆŒ ؈Œ    Ø"'ˆÔØ$ˆŒØ"$ˆŒ Ü,ˆŒ Ø!&ˆÔØ#ˆ rÚfieldscóR—|r|jj|«|Sd|_|S)aC
        Indicate the fields to be returned in the response. These fields are
        returned in addition to any others implicitly specified.
 
        ### Parameters
 
        - **fields**: If fields not specified, all the fields will be loaded.
        Otherwise, fields should be given in the format of `@field`.
        T)rCÚextendrD)rrLs  rÚloadzAggregateRequest.loadxs0€ñ Ø × Ñ × #Ñ # FÔ +ðˆ ð!ˆDŒM؈ rÚreducersc    ór—t|t«r|gn|}dtt|««g|¢}|D]i}|d|jtt|j««gz }|j |j«|j €ŒY|d|j gz }Œk|jj |«|S)a|
        Specify by which fields to group the aggregation.
 
        ### Parameters
 
        - **fields**: Fields to group by. This can either be a single string,
            or a list of strings. both cases, the field should be specified as
            `@field`.
        - **reducers**: One or more reducers. Reducers may be found in the
            `aggregation` module.
        ÚGROUPBYÚREDUCEÚAS)Ú
isinstancerÚlenr-r rNr$rB)rrLrPÚretÚreducers     rÚgroup_byzAggregateRequest.group_byˆs¨€ô(¨´Ô4&‘¸&ˆàœ#œc &›kÓ*Ð4¨VÐ4ˆØò    .ˆGØ H˜gŸl™l¬C´°G·L±LÓ0AÓ,BÐCÑ CˆCØ J‰Jw—|‘|Ô $؏~‰~Ñ)ؘ˜gŸn™nÐ-Ñ-‘ð        .ð      ×Ñ×"Ñ" 3Ô'؈ rc ó†—|j«D]-\}}d|g}||d|gz }|jj|«Œ/|S)aQ
        Specify one or more projection expressions to add to each result
 
        ### Parameters
 
        - **kwexpr**: One or more key-value pairs for a projection. The key is
            the alias for the projection, and the value is the projection
            expression itself, for example `apply(square_root="sqrt(@foo)")`
        ÚAPPLYrT)ÚitemsrBrN)rÚkwexprr&ÚexprrWs     rÚapplyzAggregateRequest.apply¢sU€ð"Ÿ<™<›>ò    ,‰KˆE4ؘD/ˆCØÐ Ø˜˜e}Ñ$Ø × Ñ × &Ñ & sÕ +ð        ,ð ˆ rr
Únumcóp—t||«}|jj|j««|S)a
        Sets the limit for the most recent group or query.
 
        If no group has been defined yet (via `group_by()`) then this sets
        the limit for the initial pool of results from the query. Otherwise,
        this limits the number of items operated on from the previous group.
 
        Setting a limit on the initial search results may be useful when
        attempting to execute an aggregation on a sample of a large data set.
 
        ### Parameters
 
        - **offset**: Result offset from which to begin paging
        - **num**: Number of results to return
 
 
        Example of sorting the initial results:
 
        ```
        AggregateRequest("@sale_amount:[10000, inf]")            .limit(0, 10)            .group_by("@state", r.count())
        ```
 
        Will only group by the states found in the first 10 results of the
        query `@sale_amount:[10000, inf]`. On the other hand,
 
        ```
        AggregateRequest("@sale_amount:[10000, inf]")            .limit(0, 1000)            .group_by("@state", r.count()            .limit(0, 10)
        ```
 
        Will group all the results matching the query, but only return the
        first 10 groups.
 
        If you only wish to return a *top-N* style query, consider using
        `sort_by()` instead.
 
        )r    rBrNr)rr
r`Ú_limits    rÚlimitzAggregateRequest.limit´s3€ôTv˜sÓ#ˆØ ×Ñ×"Ñ" 6×#4Ñ#4Ó#6Ô7؈ rcóZ—g}|D]:}t|ttf«r||j|jgz }Œ5||gz }Œ<dt t |««g}|j|«|jdd«}|dkDr|dt |«gz }|jj|«|S)a,
        Indicate how the results should be sorted. This can also be used for
        *top-N* style queries
 
        ### Parameters
 
        - **fields**: The fields by which to sort. This can be either a single
            field or a list of fields. If you wish to specify order, you can
            use the `Asc` or `Desc` wrapper classes.
        - **max**: Maximum number of results to return. This can be
            used instead of `LIMIT` and is also faster.
 
 
        Example of sorting by `foo` ascending and `bar` descending:
 
        ```
        sort_by(Asc("@foo"), Desc("@bar"))
        ```
 
        Return the top 10 customers:
 
        ```
        AggregateRequest()            .group_by("@customer", r.sum("@paid").alias(FIELDNAME))            .sort_by(Desc("@paid"), max=10)
        ```
        ÚSORTBYÚmaxrÚMAX)
rUr6r:r2r1rrVrNÚgetrB)rrLÚkwargsÚ fields_argsÚfrWrfs       rÚsort_byzAggregateRequest.sort_byâs®€ð:ˆ Øò    #ˆAܘ!œc¤4˜[Ô)Ø §¡¨¯©Ð5Ñ5‘ à ˜sÑ"‘ ð        #𠜜S Ó-Ó.Ð/ˆØ 
‰
;ÔØj‰j˜ Ó"ˆØ Š7Ø Eœ3˜s›8Ð$Ñ $ˆCà ×Ñ×"Ñ" 3Ô'؈ rÚ expressionscót—t|t«r|g}|D]}|jjd|g«Œ!|S)zÿ
        Specify filter for post-query results using predicates relating to
        values in the result set.
 
        ### Parameters
 
        - **fields**: Fields to group by. This can either be a single string,
            or a list of strings.
        ÚFILTER)rUrrBrN)rrmÚ
expressions   rÚfilterzAggregateRequest.filtersD€ô k¤3Ô 'Ø&˜-ˆKà%ò    ?ˆJØ × Ñ × &Ñ &¨°*Ð'=Õ >ð    ?ðˆ rcó—d|_|S)z|
        If set, the `schema` property will contain a list of `[field, type]`
        entries in the result object.
        T)rFrs rÚ with_schemazAggregateRequest.with_schema!s€ð
!ˆÔ؈ rcó—d|_|S)zM
        If set, includes the score as an ordinary field of the row.
        T)rJrs rÚ
add_scoreszAggregateRequest.add_scores)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`)
        )rK)rrvs  rrvzAggregateRequest.scorer0s€ðˆŒ ؈ rcó—d|_|S)NT)rGrs rÚverbatimzAggregateRequest.verbatim;s€ØˆŒØˆ rr Úmax_idlecóh—dg}|r|dt|«gz }|r|dt|dz«gz }||_|S)NÚ
WITHCURSORÚCOUNTÚMAXIDLEiè)rrH)rr rzr s    rÚcursorzAggregateRequest.cursor?sF€Øˆ~ˆÙ Ø Wœc %›jÐ)Ñ )ˆDÙ Ø Y¤ H¨t¡OÓ 4Ð5Ñ 5ˆD؈Œ ؈ rcó—|jg}|jr|jd«|jr|jd«|jr|j d|jg«|j r|jd«|jr||jz }|jr#|jd«|jd«ne|jrY|jd«|jtt|j«««|j |j«|jr&|j dt|j«g«|j |j«|S)NÚ
WITHSCHEMAÚVERBATIMÚSCORERÚ    ADDSCORESÚLOADÚ*ÚDIALECT)rArFÚappendrGrKrNrJrHrDrCrrVrIrB)rrWs  rrzAggregateRequest.build_argsHs€à{‰{ˆmˆà × Ò Ø J‰J|Ô $à >Š>Ø J‰JzÔ "à <Š<Ø J‰J˜ $§,¡,Ð/Ô 0à × Ò Ø J‰J{Ô #à <Š<Ø 4—<‘<Ñ ˆCà =Š=Ø J‰JvÔ Ø J‰JsOà × Ò Ø J‰JvÔ Ø J‰J”sœ3˜t×/Ñ/Ó0Ó1Ô 2Ø J‰Jt×'Ñ'Ô (à =Š=Ø J‰J˜    ¤3 t§}¡}Ó#5Ð6Ô 7à 
‰
4×&Ñ&Ô'àˆ
rÚdialectcó—||_|S)zƒ
        Add a dialect field to the aggregate command.
 
        - **dialect** - dialect version to execute the query under
        )rI)rr‰s  rr‰zAggregateRequest.dialectks€ð  ˆŒ ؈ r)r†)r r=)rg)rrrr,rrrOrrrrYr_rrcrlrqrsrurvryÚfloatrrr‰rrrr=r=Zs„ññ$˜cð$¨Dó$ð2˜CðÐ$6óð Ø˜C  c¡˜NÑ+ðØ8?ðà    óó4ð$,˜Cð, cð,Ð.@ó,ð\+˜sð+Ð1Có+ðZ %¨¨T°#©Y¨Ñ"7ðÐ<Nóó$óð    ˜Sð    Ð%7ó    óñ˜Cð¨uðÐ?Qóð!˜D ™Ió!ðF˜sðÐ'9ôrr=có"—eZdZdeddfd„Zd„Zy)ÚCursorÚcidr Ncó.—||_d|_d|_y)Nr)rŽrzr ©rrŽs  rrzCursor.__init__vs€ØˆŒØˆŒ ؈
rcóʗt|j«g}|jr|dt|j«gz }|jr|dt|j«gz }|S)Nr~r})rrŽrzr r%s  rrzCursor.build_args{sS€ÜD—H‘H“ ˆˆØ =Š=Ø Y¤ D§M¡MÓ 2Ð3Ñ 3ˆDØ :Š:Ø Wœc $§*¡*›oÐ.Ñ .ˆD؈ rrrrrrrus„ð˜Cð Dóó
rrcó(—eZdZdeddfd„Zdefd„Zy)ÚAggregateResultrr Ncó.—||_||_||_yr)ÚrowsrÚschema)rr•rr–s    rrzAggregateResult.__init__…s€ØˆŒ    ØˆŒ ؈ rc    óʗ|jr|jjnd}d|jj›dt    |«d›dt |j «›d|›d    S)Néÿÿÿÿú<z at 0xÚxz Rows=z    , Cursor=ú>)rrŽÚ    __class__rÚidrVr•rs  rÚ__repr__zAggregateResult.__repr__ŠsZ€Ø!%§¢ˆdk‰koŠo°"ˆà—‘×'Ñ'Ð(¨¬r°$«x¸¨lð;ܘŸ    ™    “NÐ# 9¨S¨E°ð 4ð    
r)rrrrrrržrrrr“r“„s!„ð Vð¸óð
 
˜#ô
rr“N)ÚtypingrrrrÚredis.commands.search.dialectrÚobjectr)r    rr0r6r:r=rr“rrrú<module>r¢smðß/Ó/å9á ‹H€    ÷    ñ    ÷(ñ(÷Vñôˆ-ôôˆ=ô÷XñX÷v ñ ÷ 
ò 
r