@@ -27,6 +27,9 @@ public interface IFunctionScoreQuery : IQuery
2727 [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
2828 FunctionBoostMode ? BoostMode { get ; set ; }
2929
30+ [ JsonProperty ( "max_boost" ) ]
31+ float ? MaxBoost { get ; set ; }
32+
3033 [ JsonProperty ( PropertyName = "random_score" ) ]
3134 IRandomScoreFunction RandomScore { get ; set ; }
3235
@@ -46,6 +49,7 @@ protected override void WrapInContainer(IQueryContainer container)
4649 public IQueryContainer Query { get ; set ; }
4750 public FunctionScoreMode ? ScoreMode { get ; set ; }
4851 public FunctionBoostMode ? BoostMode { get ; set ; }
52+ public float ? MaxBoost { get ; set ; }
4953 public IRandomScoreFunction RandomScore { get ; set ; }
5054 public IScriptFilter ScriptScore { get ; set ; }
5155 }
@@ -60,6 +64,8 @@ public class FunctionScoreQueryDescriptor<T> : IFunctionScoreQuery where T : cla
6064
6165 FunctionBoostMode ? IFunctionScoreQuery . BoostMode { get ; set ; }
6266
67+ float ? IFunctionScoreQuery . MaxBoost { get ; set ; }
68+
6369 IRandomScoreFunction IFunctionScoreQuery . RandomScore { get ; set ; }
6470
6571 IScriptFilter IFunctionScoreQuery . ScriptScore { get ; set ; }
@@ -110,6 +116,12 @@ public FunctionScoreQueryDescriptor<T> BoostMode(FunctionBoostMode mode)
110116 return this ;
111117 }
112118
119+ public FunctionScoreQueryDescriptor < T > MaxBoost ( float maxBoost )
120+ {
121+ ( ( IFunctionScoreQuery ) this ) . MaxBoost = maxBoost ;
122+ return this ;
123+ }
124+
113125 public FunctionScoreQueryDescriptor < T > RandomScore ( int ? seed = null )
114126 {
115127 ( ( IFunctionScoreQuery ) this ) . RandomScore = new RandomScoreFunction ( ) ;
0 commit comments