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):
551551 name = "terms"
552552
553553 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 )
555558
556559
557560class TermsSet (Query ):
Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ def test_terms_to_dict() -> None:
8686 ).to_dict ()
8787
8888
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+
8995def test_bool_to_dict () -> None :
9096 bool = query .Bool (must = [query .Match (f = "value" )], should = [])
9197
You can’t perform that action at this time.
0 commit comments