Package org.elasticsearch.common.xcontent

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


            builder.endObject();
        } else {
            // Multiple transforms
            int total = between(1, 10);
            int actual = between(0, total - 1);
            builder.startArray();
            for (int s = 0; s < total; s++) {
                builder.startObject();
                if (s == actual) {
                    buildTransformScript(builder);
                } else {
View Full Code Here


    public XContentBuilder reconstruct(int shardId) throws IOException {
        XContentBuilder builder = jsonBuilder();
        builder.startObject()
                .field("shardId", shardId)
                .field("numDeletions", reader.numDeletedDocs());
        builder.startArray("docs");
        FieldInfos fieldInfos = reader.getFieldInfos();
        Bits live = MultiFields.getLiveDocs(reader);
        for (int docNum = 0; docNum < reader.maxDoc(); docNum++) {
            Document doc = reader.document(docNum);
            if (live != null && live.get(docNum)) {
View Full Code Here

                        }
                    }
                }
            }
            builder.endArray();
            builder.startArray("terms");
            if (fieldInfos != null) {
                TermsEnum te = null;
                DocsAndPositionsEnum dpe = null;
                for (FieldInfo fi : fieldInfos) {
                    Terms terms = MultiFields.getTerms(reader, fi.name);
View Full Code Here

                XContentBuilder builder = XContentFactory.jsonBuilder();
                builder.startObject();
                builder.field("ok", true);
                builder.startObject("state");
                response.getState().toXContent(builder, ToXContent.EMPTY_PARAMS);
                builder.startArray("files");
                for (File file : response.getFiles()) {
                    Instant instant = new Instant(file.lastModified());
                    builder.startObject()
                            .field("path", file.getAbsolutePath())
                            .field("lastmodified", instant.toDateTime().toString())
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.