File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -551,7 +551,10 @@ class Terms(Query):
551
551
name = "terms"
552
552
553
553
def _setattr (self , name : str , value : Any ) -> None :
554
- super ()._setattr (name , list (value ))
554
+ if name != "boost" :
555
+ value = list (value )
556
+
557
+ super ()._setattr (name , value )
555
558
556
559
557
560
class TermsSet (Query ):
Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ def test_terms_to_dict() -> None:
86
86
).to_dict ()
87
87
88
88
89
+ def test_terms_to_dict_should_accept_boost_param () -> None :
90
+ assert {"terms" : {"_type" : ["article" , "section" ], "boost" : 2 }} == query .Terms (
91
+ _type = ["article" , "section" ], boost = 2
92
+ ).to_dict ()
93
+
94
+
89
95
def test_bool_to_dict () -> None :
90
96
bool = query .Bool (must = [query .Match (f = "value" )], should = [])
91
97
You can’t perform that action at this time.
0 commit comments