public MultiMatchQueryDescriptor <T> OnFieldsWithBoost(Action <FluentDictionary <Expression <Func <T, object> >, double?> > boostableSelector) { var d = new FluentDictionary <Expression <Func <T, object> >, double?>(); boostableSelector(d); this._Fields = d.Select(o => PropertyPathMarker.Create(o.Key, o.Value)); return(this); }
public MultiMatchQueryDescriptor <T> OnFieldsWithBoost(Action <FluentDictionary <string, double?> > boostableSelector) { var d = new FluentDictionary <string, double?>(); boostableSelector(d); ((IMultiMatchQuery)this).Fields = d.Select(o => PropertyPathMarker.Create(o.Key, o.Value)); return(this); }
public QueryStringDescriptor <T> OnFieldsWithBoost( Action <FluentDictionary <string, double?> > boostableSelector) { var d = new FluentDictionary <string, double?>(); boostableSelector(d); var fieldNames = d .Select(o => "{0}^{1}".F(o.Key, o.Value.GetValueOrDefault(1.0).ToString(CultureInfo.InvariantCulture))); return(this.OnFields(fieldNames)); }
public QueryStringDescriptor <T> OnFieldsWithBoost( Action <FluentDictionary <Expression <Func <T, object> >, double?> > boostableSelector) { var d = new FluentDictionary <Expression <Func <T, object> >, double?>(); boostableSelector(d); var fieldNames = d .Select(o => { var field = new PropertyNameResolver().Resolve(o.Key); var boost = o.Value.GetValueOrDefault(1.0); return("{0}^{1}".F(field, boost.ToString(CultureInfo.InvariantCulture))); }); return(this.OnFields(fieldNames)); }