Skip to content

Commit 104f179

Browse files
committed
allow fields boosting in MultiMatchQuery
1 parent 47d9c09 commit 104f179

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Nest/DSL/Query/MultiMatchQueryDescriptor.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ public MultiMatchQueryDescriptor<T> OnFields(
7777
this._Fields = objectPaths.Select(e=>(PropertyPathMarker)e);
7878
return this;
7979
}
80+
public MultiMatchQueryDescriptor<T> OnFieldsWithBoost(Action<FluentDictionary<Expression<Func<T, object>>, double?>> boostableSelector)
81+
{
82+
var d = new FluentDictionary<Expression<Func<T, object>>, double?>();
83+
boostableSelector(d);
84+
this._Fields = d.Select(o => PropertyPathMarker.Create(o.Key, o.Value));
85+
return this;
86+
}
8087

8188
public MultiMatchQueryDescriptor<T> Query(string query)
8289
{

0 commit comments

Comments
 (0)