org.elasticsearch.index.query
Class WrapperQueryBuilder
java.lang.Object
org.elasticsearch.index.query.BaseQueryBuilder
org.elasticsearch.index.query.WrapperQueryBuilder
- All Implemented Interfaces:
- ToXContent, QueryBuilder
public class WrapperQueryBuilder
- extends BaseQueryBuilder
A Query builder which allows building a query thanks to a JSON string or binary data. This is useful when you want
to use the Java Builder API but still have JSON query strings at hand that you want to combine with other
query builders.
Example usage in a boolean query :
BoolQueryBuilder bool = new BoolQueryBuilder();
bool.must(new WrapperQueryBuilder("{\"term\": {\"field\":\"value\"}}");
bool.must(new TermQueryBuilder("field2","value2");
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WrapperQueryBuilder
public WrapperQueryBuilder(java.lang.String source)
- Builds a JSONQueryBuilder using the provided JSON query string.
WrapperQueryBuilder
public WrapperQueryBuilder(byte[] source,
int offset,
int length)
doXContent
protected void doXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Specified by:
doXContent
in class BaseQueryBuilder
- Throws:
java.io.IOException