public void ImplicitConversion() { Nest.Distance distanceString = "25"; Nest.Distance distanceStringWithUnits = "25m"; Expect(new Nest.Distance(25)) .WhenSerializing(distanceString) .WhenSerializing(distanceStringWithUnits); }
public void Constructor() { var unitComposed = new Nest.Distance(25); var unitComposedWithUnits = new Nest.Distance(25, DistanceUnit.Meters); /** * When serializing Distance constructed from a string, composition of distance value and unit */ Expect("25.0m") .WhenSerializing(unitComposed) .WhenSerializing(unitComposedWithUnits); }
public void Constructor() { var unitComposed = new Distance(25); var unitComposedWithUnits = new Distance(25, Nest.DistanceUnit.Meters); /** * `Distance` serializes to a string composed of a factor and distance unit. * The factor is a double so always has at least one decimal place when serialized */ Expect("25.0m") .WhenSerializing(unitComposed) .WhenSerializing(unitComposedWithUnits); }
public GeoHashCellQueryDescriptor <T> Precision(Distance precision) => Assign(a => a.Precision = precision);
public SuggestContextQueryDescriptor <T> Precision(Distance precision) => Assign(a => a.Precision = precision);
public GeoSuggestContextDescriptor <T> Precision(Distance precision) => Assign(precision, (a, v) => a.Precision = v);
public GeoPointFielddataDescriptor Precision(Distance distance) => Assign(distance, (a, v) => a.Precision = v);
public GeoDistanceQueryDescriptor <T> Distance(Distance distance) => Assign(a => a.Distance = distance);