NamedWriteable
, Writeable
, ToXContent
, ToXContentObject
, QueryBuilder
, Rewriteable<QueryBuilder>
public class MatchPhraseQueryBuilder extends AbstractQueryBuilder<MatchPhraseQueryBuilder>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
NAME |
|
static ParseField |
SLOP_FIELD |
|
static ParseField |
ZERO_TERMS_QUERY_FIELD |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
MAX_REWRITE_ROUNDS
EMPTY_PARAMS
Constructor | Description |
---|---|
MatchPhraseQueryBuilder(java.lang.String fieldName,
java.lang.Object value) |
|
MatchPhraseQueryBuilder(StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
analyzer() |
Get the analyzer to use, if previously set, otherwise null
|
MatchPhraseQueryBuilder |
analyzer(java.lang.String analyzer) |
Explicitly set the analyzer to use.
|
protected boolean |
doEquals(MatchPhraseQueryBuilder 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) |
|
java.lang.String |
fieldName() |
Returns the field name used in this query.
|
static MatchPhraseQueryBuilder |
fromXContent(XContentParser parser) |
|
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
int |
slop() |
Get the slop factor for phrase queries.
|
MatchPhraseQueryBuilder |
slop(int slop) |
Sets a slop factor for phrase queries
|
java.lang.Object |
value() |
Returns the value used in this query.
|
MatchQuery.ZeroTermsQuery |
zeroTermsQuery() |
|
MatchPhraseQueryBuilder |
zeroTermsQuery(MatchQuery.ZeroTermsQuery zeroTermsQuery) |
Sets query to use in case no query terms are available, e.g.
|
addValidationError, boost, boost, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQuery, toString, toXContent, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final java.lang.String NAME
public static final ParseField SLOP_FIELD
public static final ParseField ZERO_TERMS_QUERY_FIELD
public MatchPhraseQueryBuilder(java.lang.String fieldName, java.lang.Object value)
public MatchPhraseQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<MatchPhraseQueryBuilder>
java.io.IOException
public java.lang.String fieldName()
public java.lang.Object value()
public MatchPhraseQueryBuilder analyzer(java.lang.String analyzer)
public java.lang.String analyzer()
public MatchPhraseQueryBuilder slop(int slop)
public int slop()
public MatchPhraseQueryBuilder zeroTermsQuery(MatchQuery.ZeroTermsQuery zeroTermsQuery)
MatchQuery.ZeroTermsQuery.NONE
, but can be set to
MatchQuery.ZeroTermsQuery.ALL
instead.public MatchQuery.ZeroTermsQuery zeroTermsQuery()
public java.lang.String getWriteableName()
NamedWriteable
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class AbstractQueryBuilder<MatchPhraseQueryBuilder>
java.io.IOException
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<MatchPhraseQueryBuilder>
java.io.IOException
protected boolean doEquals(MatchPhraseQueryBuilder other)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<MatchPhraseQueryBuilder>
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<MatchPhraseQueryBuilder>
public static MatchPhraseQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException