Span First Query Usage

edit

Fluent DSL example

edit
q
.SpanFirst(c => c
    .Name("named_query")
    .Boost(1.1)
    .Match(sq=>sq
        .SpanTerm(st=>st.Field(p=>p.Name).Value("value"))
    )
    .End(3)
)

Object Initializer syntax example

edit
new SpanFirstQuery
{
    Name = "named_query",
    Boost = 1.1,
    End = 3,
    Match = new SpanQuery
    {
        SpanTerm = new SpanTermQuery { Field = "name", Value = "value" }
    }
}

Example json output.

{
  "span_first": {
    "_name": "named_query",
    "boost": 1.1,
    "match": {
      "span_term": {
        "name": {
          "value": "value"
        }
      }
    },
    "end": 3
  }
}