java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<RegexpQueryBuilder>
org.elasticsearch.index.query.RegexpQueryBuilder
- All Implemented Interfaces:
NamedWriteable
,VersionedNamedWriteable
,Writeable
,MultiTermQueryBuilder
,QueryBuilder
,Rewriteable<QueryBuilder>
,ToXContent
,ToXContentObject
public class RegexpQueryBuilder
extends AbstractQueryBuilder<RegexpQueryBuilder>
implements MultiTermQueryBuilder
A Query that does fuzzy matching for a specific value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
static final int
static final int
static final String
Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionRegexpQueryBuilder
(String fieldName, String value) Constructs a new regex query.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionboolean
caseInsensitive
(boolean caseInsensitive) protected boolean
doEquals
(RegexpQueryBuilder other) Indicates whether some otherQueryBuilder
object of the same type is "equal to" this one.protected int
protected org.apache.lucene.search.Query
doToQuery
(SearchExecutionContext context) protected void
doWriteTo
(StreamOutput out) protected void
doXContent
(XContentBuilder builder, ToXContent.Params params) Returns the field name used in this query.int
flags()
flags
(int flags) flags
(RegexpFlag... flags) static RegexpQueryBuilder
fromXContent
(XContentParser parser) The minimal version of the recipient this object can be sent toReturns the name of the writeable objectint
maxDeterminizedStates
(int value) Sets the regexp maxDeterminizedStates.rewrite()
value()
Returns the value used in this query.Methods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, boostAndQueryNameToXContent, checkNegativeBoost, declareStandardFields, doCoordinatorRewrite, doIndexMetadataRewrite, doRewrite, doSearchRewrite, equals, extractInnerHitBuilders, getMaxNestedDepth, getName, hashCode, parseInnerQueryBuilder, parseTopLevelQuery, parseTopLevelQuery, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, setMaxNestedDepth, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeQueries, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.index.query.QueryBuilder
boost, boost, getName, queryName, queryName, rewrite, toQuery
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
DEFAULT_FLAGS_VALUE
public static final int DEFAULT_FLAGS_VALUE -
DEFAULT_MAX_DETERMINIZED_STATES
public static final int DEFAULT_MAX_DETERMINIZED_STATES- See Also:
-
DEFAULT_CASE_INSENSITIVITY
public static final boolean DEFAULT_CASE_INSENSITIVITY- See Also:
-
-
Constructor Details
-
RegexpQueryBuilder
Constructs a new regex query.- Parameters:
fieldName
- The name of the fieldvalue
- The regular expression
-
RegexpQueryBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<RegexpQueryBuilder>
- Throws:
IOException
-
fieldName
Returns the field name used in this query.- Specified by:
fieldName
in interfaceMultiTermQueryBuilder
-
value
Returns the value used in this query. -
flags
-
flags
-
flags
public int flags() -
caseInsensitive
-
caseInsensitive
public boolean caseInsensitive() -
maxDeterminizedStates
Sets the regexp maxDeterminizedStates. -
maxDeterminizedStates
public int maxDeterminizedStates() -
rewrite
-
rewrite
-
doXContent
- Specified by:
doXContent
in classAbstractQueryBuilder<RegexpQueryBuilder>
- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
- Specified by:
getWriteableName
in interfaceVersionedNamedWriteable
-
doToQuery
protected org.apache.lucene.search.Query doToQuery(SearchExecutionContext context) throws QueryShardException, IOException - Specified by:
doToQuery
in classAbstractQueryBuilder<RegexpQueryBuilder>
- Throws:
QueryShardException
IOException
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<RegexpQueryBuilder>
-
doEquals
Description copied from class:AbstractQueryBuilder
Indicates whether some otherQueryBuilder
object of the same type is "equal to" this one.- Specified by:
doEquals
in classAbstractQueryBuilder<RegexpQueryBuilder>
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteable
The minimal version of the recipient this object can be sent to- Specified by:
getMinimalSupportedVersion
in interfaceVersionedNamedWriteable
-