public class WrapperQueryBuilder extends AbstractQueryBuilder<WrapperQueryBuilder>
Example usage in a boolean query :
BoolQueryBuilder bool = new BoolQueryBuilder();
bool.must(new WrapperQueryBuilder("{\"term\": {\"field\":\"value\"}}");
bool.must(new TermQueryBuilder("field2","value2");
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
EMPTY_PARAMS
Constructor and Description |
---|
WrapperQueryBuilder(byte[] source)
Creates a query builder given a query provided as a bytes array
|
WrapperQueryBuilder(BytesReference source)
Creates a query builder given a query provided as a
BytesReference |
WrapperQueryBuilder(StreamInput in)
Read from a stream.
|
WrapperQueryBuilder(java.lang.String source)
Creates a query builder given a query provided as a string
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquals(WrapperQueryBuilder other)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected QueryBuilder |
doRewrite(QueryRewriteContext context) |
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<WrapperQueryBuilder> |
fromXContent(QueryParseContext parseContext) |
java.lang.String |
getName()
Returns the name that identifies uniquely the query
|
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
byte[] |
source() |
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, equals, extractInnerHitBuilders, 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
rewriteQuery
isFragment
public static final java.lang.String NAME
public WrapperQueryBuilder(byte[] source)
public WrapperQueryBuilder(java.lang.String source)
public WrapperQueryBuilder(BytesReference source)
BytesReference
public WrapperQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<WrapperQueryBuilder>
java.io.IOException
public byte[] source()
public java.lang.String getName()
QueryBuilder
getName
in interface QueryBuilder
getName
in class AbstractQueryBuilder<WrapperQueryBuilder>
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class AbstractQueryBuilder<WrapperQueryBuilder>
java.io.IOException
public static java.util.Optional<WrapperQueryBuilder> fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOException
public java.lang.String getWriteableName()
NamedWriteable
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<WrapperQueryBuilder>
java.io.IOException
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<WrapperQueryBuilder>
protected boolean doEquals(WrapperQueryBuilder other)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<WrapperQueryBuilder>
protected QueryBuilder doRewrite(QueryRewriteContext context) throws java.io.IOException
doRewrite
in class AbstractQueryBuilder<WrapperQueryBuilder>
java.io.IOException