Numeric Range Query Usageedit

Fluent DSL exampleedit

q
.Range(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .GreaterThan(1.0)
    .GreaterThanOrEquals(1.1)
    .LessThan(2.1)
    .LessThanOrEquals(2.0)
    .Relation(RangeRelation.Within)
)

Object Initializer syntax exampleedit

new NumericRangeQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = "description",
    GreaterThan = 1.0,
    GreaterThanOrEqualTo = 1.1,
    LessThan = 2.1,
    LessThanOrEqualTo = 2.0,
    Relation = RangeRelation.Within
}

Example json output. 

{
  "range": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "gt": 1.0,
      "gte": 1.1,
      "lt": 2.1,
      "lte": 2.0,
      "relation": "within"
    }
  }
}