Term Range Query Usage

edit

Fluent DSL example

edit
q
.TermRange(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .GreaterThan("foo")
    .GreaterThanOrEquals("foof")
    .LessThan("bar")
    .LessThanOrEquals("barb")
)

Object Initializer syntax example

edit
new TermRangeQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = "description",
    GreaterThan = "foo",
    GreaterThanOrEqualTo = "foof",
    LessThan = "bar",
    LessThanOrEqualTo = "barb"
}

Example json output.

{
  "range": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "gt": "foo",
      "gte": "foof",
      "lt": "bar",
      "lte": "barb"
    }
  }
}