@@ -2676,23 +2676,30 @@ def __init__(
26762676
26772677class MultiTermLookup (AttrDict [Any ]):
26782678 """
2679- :arg field: (required) A fields from which to retrieve terms.
2679+ :arg field: A field from which to retrieve terms. It is required if
2680+ `script` is not provided.
2681+ :arg script: A script to calculate terms to aggregate on. It is
2682+ required if `field` is not provided.
26802683 :arg missing: The value to apply to documents that do not have a
26812684 value. By default, documents without a value are ignored.
26822685 """
26832686
26842687 field : Union [str , InstrumentedField , DefaultType ]
2688+ script : Union ["Script" , Dict [str , Any ], DefaultType ]
26852689 missing : Union [str , int , float , bool , DefaultType ]
26862690
26872691 def __init__ (
26882692 self ,
26892693 * ,
26902694 field : Union [str , InstrumentedField , DefaultType ] = DEFAULT ,
2695+ script : Union ["Script" , Dict [str , Any ], DefaultType ] = DEFAULT ,
26912696 missing : Union [str , int , float , bool , DefaultType ] = DEFAULT ,
26922697 ** kwargs : Any ,
26932698 ):
26942699 if field is not DEFAULT :
26952700 kwargs ["field" ] = str (field )
2701+ if script is not DEFAULT :
2702+ kwargs ["script" ] = script
26962703 if missing is not DEFAULT :
26972704 kwargs ["missing" ] = missing
26982705 super ().__init__ (kwargs )
0 commit comments