Package org.elasticsearch.common.xcontent

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


                    builder.startObject();
                    builder.field("cluster_name", result.clusterName().value());

                    builder.startObject("nodes");
                    for (NodeStats nodeStats : result) {
                        builder.startObject(nodeStats.node().id(), XContentBuilder.FieldCaseConversion.NONE);

                        builder.field("name", nodeStats.node().name());

                        if (nodeStats.indices() != null) {
                            nodeStats.indices().toXContent(builder, request);
View Full Code Here


                builder.field("truncated", status.isTruncated());

                if (status.getUserMentionEntities() != null) {
                    builder.startArray("mention");
                    for (UserMentionEntity user : status.getUserMentionEntities()) {
                        builder.startObject();
                        builder.field("id", user.getId());
                        builder.field("name", user.getName());
                        builder.field("screen_name", user.getScreenName());
                        builder.field("start", user.getStart());
                        builder.field("end", user.getEnd());
View Full Code Here

                if (status.getRetweetCount() != -1) {
                    builder.field("retweet_count", status.getRetweetCount());
                }

                if (status.getInReplyToStatusId() != -1) {
                    builder.startObject("in_reply");
                    builder.field("status", status.getInReplyToStatusId());
                    if (status.getInReplyToUserId() != -1) {
                        builder.field("user_id", status.getInReplyToUserId());
                        builder.field("user_screen_name", status.getInReplyToScreenName());
                    }
View Full Code Here

                }

                if (status.getHashtagEntities() != null) {
                    builder.startArray("hashtag");
                    for (HashtagEntity hashtag : status.getHashtagEntities()) {
                        builder.startObject();
                        builder.field("text", hashtag.getText());
                        builder.field("start", hashtag.getStart());
                        builder.field("end", hashtag.getEnd());
                        builder.endObject();
                    }
View Full Code Here

                }
                if (status.getContributors() != null) {
                    builder.array("contributor", status.getContributors());
                }
                if (status.getGeoLocation() != null) {
                    builder.startObject("location");
                    builder.field("lat", status.getGeoLocation().getLatitude());
                    builder.field("lon", status.getGeoLocation().getLongitude());
                    builder.endObject();
                }
                if (status.getPlace() != null) {
View Full Code Here

                    builder.field("lat", status.getGeoLocation().getLatitude());
                    builder.field("lon", status.getGeoLocation().getLongitude());
                    builder.endObject();
                }
                if (status.getPlace() != null) {
                    builder.startObject("place");
                    builder.field("id", status.getPlace().getId());
                    builder.field("name", status.getPlace().getName());
                    builder.field("type", status.getPlace().getPlaceType());
                    builder.field("full_name", status.getPlace().getFullName());
                    builder.field("street_address", status.getPlace().getStreetAddress());
View Full Code Here

                }
                if (status.getURLEntities() != null) {
                    builder.startArray("link");
                    for (URLEntity url : status.getURLEntities()) {
                        if (url != null) {
                            builder.startObject();
                            builder.field("url", url.getURL().toExternalForm());
                            if (url.getDisplayURL() != null) {
                                builder.field("display_url", url.getDisplayURL());
                            }
                            if (url.getExpandedURL() != null) {
View Full Code Here

                        }
                    }
                    builder.endArray();
                }
                if (status.getAnnotations() != null) {
                    builder.startObject("annotation");
                    List<Annotation> annotations = status.getAnnotations().getAnnotations();
                    for (Annotation ann : annotations) {
                        builder.startObject(ann.getType());
                        Map<String, String> attributes = ann.getAttributes();
                        for (Map.Entry<String, String> entry : attributes.entrySet()) {
View Full Code Here

                }
                if (status.getAnnotations() != null) {
                    builder.startObject("annotation");
                    List<Annotation> annotations = status.getAnnotations().getAnnotations();
                    for (Annotation ann : annotations) {
                        builder.startObject(ann.getType());
                        Map<String, String> attributes = ann.getAttributes();
                        for (Map.Entry<String, String> entry : attributes.entrySet()) {
                            builder.field(entry.getKey(), entry.getValue());
                        }
                        builder.endObject();
View Full Code Here

                        builder.endObject();
                    }
                    builder.endObject();
                }

                builder.startObject("user");
                builder.field("id", status.getUser().getId());
                builder.field("name", status.getUser().getName());
                builder.field("screen_name", status.getUser().getScreenName());
                builder.field("location", status.getUser().getLocation());
                builder.field("description", status.getUser().getDescription());
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.