Examples of unsafeStream()


Examples of org.elasticsearch.common.xcontent.XContentBuilder.unsafeStream()

    public void addQuery(String name, QueryBuilder queryBuilder) throws ElasticSearchException {
        try {
            XContentBuilder builder = XContentFactory.smileBuilder()
                    .startObject().field("query", queryBuilder).endObject();
            BytesStream unsafeBytes = builder.unsafeStream();
            addQuery(name, unsafeBytes.unsafeByteArray(), 0, unsafeBytes.size());
        } catch (IOException e) {
            throw new ElasticSearchException("Failed to add query [" + name + "]", e);
        }
    }
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.unsafeStream()

    public BytesStream buildAsUnsafeBytes(XContentType contentType) throws SearchSourceBuilderException {
        try {
            XContentBuilder builder = XContentFactory.contentBuilder(contentType);
            toXContent(builder, ToXContent.EMPTY_PARAMS);
            return builder.unsafeStream();
        } catch (Exception e) {
            throw new SearchSourceBuilderException("Failed to build search source", e);
        }
    }
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.unsafeStream()

    @Override public BytesStream buildAsUnsafeBytes(XContentType contentType) throws QueryBuilderException {
        try {
            XContentBuilder builder = XContentFactory.contentBuilder(contentType);
            toXContent(builder, EMPTY_PARAMS);
            return builder.unsafeStream();
        } catch (Exception e) {
            throw new QueryBuilderException("Failed to build query", e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.