@@ -161,10 +161,10 @@ def set_source_expressions(self, exprs):
161
161
def search_operator (self , compiler , connection ):
162
162
params = {
163
163
"path" : self .path .as_mql (compiler , connection , as_path = True ),
164
- "value" : self .value .as_mql (compiler , connection , as_path = True ),
164
+ "value" : self .value .as_mql (compiler , connection ),
165
165
}
166
166
if self .score is not None :
167
- params ["score" ] = self .score .as_mql (compiler , connection , as_path = True )
167
+ params ["score" ] = self .score .as_mql (compiler , connection )
168
168
return {"equals" : params }
169
169
170
170
@@ -211,7 +211,7 @@ def set_source_expressions(self, exprs):
211
211
def search_operator (self , compiler , connection ):
212
212
params = {
213
213
"path" : self .path .as_mql (compiler , connection , as_path = True ),
214
- "value" : self .value .as_mql (compiler , connection , as_path = True ),
214
+ "value" : self .value .as_mql (compiler , connection ),
215
215
}
216
216
if self .score is not None :
217
217
params ["score" ] = self .score .definitions
@@ -234,19 +234,19 @@ def get_source_expressions(self):
234
234
return [self .path , self .query , self .slop , self .synonyms ]
235
235
236
236
def set_source_expressions (self , exprs ):
237
- self .path , self .query , self .score , self . slop , self .synonyms = exprs
237
+ self .path , self .query , self .slop , self .synonyms = exprs
238
238
239
239
def search_operator (self , compiler , connection ):
240
240
params = {
241
241
"path" : self .path .as_mql (compiler , connection , as_path = True ),
242
- "query" : self .query .as_mql (compiler , connection , as_path = True ),
242
+ "query" : self .query .as_mql (compiler , connection ),
243
243
}
244
244
if self .score is not None :
245
- params ["score" ] = self .score .as_mql (compiler , connection , as_path = True )
245
+ params ["score" ] = self .score .as_mql (compiler , connection )
246
246
if self .slop is not None :
247
- params ["slop" ] = self .slop .as_mql (compiler , connection , as_path = True )
247
+ params ["slop" ] = self .slop .as_mql (compiler , connection )
248
248
if self .synonyms is not None :
249
- params ["synonyms" ] = self .synonyms .as_mql (compiler , connection , as_path = True )
249
+ params ["synonyms" ] = self .synonyms .as_mql (compiler , connection )
250
250
return {"phrase" : params }
251
251
252
252
@@ -268,8 +268,8 @@ def set_source_expressions(self, exprs):
268
268
269
269
def search_operator (self , compiler , connection ):
270
270
params = {
271
- "defaultPath" : self .path ,
272
- "query" : self .query .as_mql (compiler , connection , as_path = True ),
271
+ "defaultPath" : self .path . as_mql ( compiler , connection , as_path = True ) ,
272
+ "query" : self .query .as_mql (compiler , connection ),
273
273
}
274
274
if self .score is not None :
275
275
params ["score" ] = self .score .definitions
@@ -290,10 +290,10 @@ def get_search_fields(self, compiler, connection):
290
290
return {self .path .as_mql (compiler , connection , as_path = True )}
291
291
292
292
def get_source_expressions (self ):
293
- return [self .path , self .query , self . lt , self .lte , self .gt , self .gte ]
293
+ return [self .path , self .lt , self .lte , self .gt , self .gte ]
294
294
295
295
def set_source_expressions (self , exprs ):
296
- self .path , self .query , self . lt , self .lte , self .gt , self .gte = exprs
296
+ self .path , self .lt , self .lte , self .gt , self .gte = exprs
297
297
298
298
def search_operator (self , compiler , connection ):
299
299
params = {
@@ -302,13 +302,13 @@ def search_operator(self, compiler, connection):
302
302
if self .score is not None :
303
303
params ["score" ] = self .score .definitions
304
304
if self .lt is not None :
305
- params ["lt" ] = self .lt
305
+ params ["lt" ] = self .lt . as_mql ( compiler , connection )
306
306
if self .lte is not None :
307
- params ["lte" ] = self .lte
307
+ params ["lte" ] = self .lte . as_mql ( compiler , connection )
308
308
if self .gt is not None :
309
- params ["gt" ] = self .gt
309
+ params ["gt" ] = self .gt . as_mql ( compiler , connection )
310
310
if self .gte is not None :
311
- params ["gte" ] = self .gte
311
+ params ["gte" ] = self .gte . as_mql ( compiler , connection )
312
312
return {"range" : params }
313
313
314
314
0 commit comments