public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuilder> implements SpanQueryBuilder
SpanNearQuery
.Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_IN_ORDER
Default for flag controlling whether matches are required to be in-order
|
static int |
DEFAULT_SLOP
Default slop value, this is the same that lucene
SpanNearQuery uses if no slop is provided |
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
EMPTY_PARAMS
Constructor and Description |
---|
SpanNearQueryBuilder(SpanQueryBuilder initialClause,
int slop) |
SpanNearQueryBuilder(StreamInput in)
Read from a stream.
|
Modifier and Type | Method and Description |
---|---|
SpanNearQueryBuilder |
addClause(SpanQueryBuilder clause)
Add a span clause to the current list of clauses
|
java.util.List<SpanQueryBuilder> |
clauses() |
protected boolean |
doEquals(SpanNearQueryBuilder other)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected org.apache.lucene.search.Query |
doToQuery(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
static java.util.Optional<SpanNearQueryBuilder> |
fromXContent(QueryParseContext parseContext) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
boolean |
inOrder() |
SpanNearQueryBuilder |
inOrder(boolean inOrder)
When
inOrder is true, the spans from each clause
must be in the same order as in clauses and must be non-overlapping. |
int |
slop() |
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, getName, hashCode, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTo
buildAsBytes, buildAsBytes, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
boost, boost, getName, queryName, queryName, rewrite, rewriteQuery, toFilter, toQuery
isFragment
toXContent
public static final java.lang.String NAME
public static boolean DEFAULT_IN_ORDER
public static int DEFAULT_SLOP
SpanNearQuery
uses if no slop is providedpublic SpanNearQueryBuilder(SpanQueryBuilder initialClause, int slop)
initialClause
- an initial span query clauseslop
- controls the maximum number of intervening unmatched positions permittedpublic SpanNearQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<SpanNearQueryBuilder>
java.io.IOException
public int slop()
public SpanNearQueryBuilder addClause(SpanQueryBuilder clause)
public java.util.List<SpanQueryBuilder> clauses()
SpanQueryBuilder
clauses that were set for this querypublic SpanNearQueryBuilder inOrder(boolean inOrder)
inOrder
is true, the spans from each clause
must be in the same order as in clauses
and must be non-overlapping.
Defaults to true
public boolean inOrder()
inOrder(boolean)
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class AbstractQueryBuilder<SpanNearQueryBuilder>
java.io.IOException
public static java.util.Optional<SpanNearQueryBuilder> fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOException
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<SpanNearQueryBuilder>
java.io.IOException
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<SpanNearQueryBuilder>
protected boolean doEquals(SpanNearQueryBuilder other)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<SpanNearQueryBuilder>
public java.lang.String getWriteableName()
NamedWriteable
getWriteableName
in interface NamedWriteable