WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Span Near Query Usage
editSpan Near Query Usage
editFluent DSL example
editq .SpanNear(sn => sn .Name("named_query") .Boost(1.1) .Clauses( c=>c.SpanTerm(st=>st.Field("field").Value("value1")), c=>c.SpanTerm(st=>st.Field("field").Value("value2")), c=>c.SpanTerm(st=>st.Field("field").Value("value3")) ) .Slop(12) .InOrder(false) .CollectPayloads(false) )
Object Initializer syntax example
editnew SpanNearQuery { Name = "named_query", Boost = 1.1, Clauses = new List<ISpanQuery> { new SpanQuery { SpanTerm = new SpanTermQuery { Field = "field", Value = "value1" } }, new SpanQuery { SpanTerm = new SpanTermQuery { Field = "field", Value = "value2" } }, new SpanQuery { SpanTerm = new SpanTermQuery { Field = "field", Value = "value3" } } }, Slop = 12, InOrder = false, CollectPayloads = false }
Example json output.
{ "span_near": { "clauses": [ { "span_term": { "field": { "value": "value1" } } }, { "span_term": { "field": { "value": "value2" } } }, { "span_term": { "field": { "value": "value3" } } } ], "slop": 12, "in_order": false, "collect_payloads": false, "_name": "named_query", "boost": 1.1 } }