You are looking at documentation for an older release.
Not what you want? See the
current release documentation.
Span Not Query Usageedit
Fluent DSL Exampleedit
q
.SpanNot(sn => sn
.Name("named_query")
.Boost(1.1)
.Dist(12)
.Post(13)
.Pre(14)
.Include(i => i
.SpanTerm(st => st.Field("field1").Value("hoya"))
)
.Exclude(e => e
.SpanTerm(st => st.Field("field1").Value("hoya2"))
)
)Object Initializer Syntax Exampleedit
new SpanNotQuery
{
Name = "named_query",
Boost = 1.1,
Dist = 12,
Post = 13,
Pre = 14,
Include = new SpanQuery
{
SpanTerm = new SpanTermQuery
{
Field = "field1", Value = "hoya"
}
},
Exclude = new SpanQuery
{
SpanTerm = new SpanTermQuery
{
Field = "field1", Value = "hoya2"
}
},
}Example json output.
{
"span_not": {
"_name": "named_query",
"boost": 1.1,
"include": {
"span_term": {
"field1": {
"value": "hoya"
}
}
},
"exclude": {
"span_term": {
"field1": {
"value": "hoya2"
}
}
},
"pre": 14,
"post": 13,
"dist": 12
}
}