Long Range Query Usage

edit

Fluent DSL example

edit
q
.LongRange(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .GreaterThan(636634079999999999)
    .GreaterThanOrEquals(636634080000000000)
    .LessThan(636634080000000000)
    .LessThanOrEquals(636634079999999999)
    .Relation(RangeRelation.Within)
)

Object Initializer syntax example

edit
new LongRangeQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = "description",
    GreaterThan = 636634079999999999,
    GreaterThanOrEqualTo = 636634080000000000,
    LessThan = 636634080000000000,
    LessThanOrEqualTo = 636634079999999999,
    Relation = RangeRelation.Within
}

Example json output.

{
  "range": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "gt": 636634079999999999,
      "gte": 636634080000000000,
      "lt": 636634080000000000,
      "lte": 636634079999999999,
      "relation": "within"
    }
  }
}