Package org.elasticsearch.common.xcontent

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


        XContentBuilder builder = channel.newBuilder().startObject();
        builder.field("word", word);
        builder.field("wordType", wordType);
        if (wordType != HebrewAnalyzer.WordType.UNRECOGNIZED && wordType != HebrewAnalyzer.WordType.NON_HEBREW) {
            builder.startArray("lemmas");
            for (String lemma : getLemmas(word)) {
                builder.value(lemma);
            }
            builder.endArray();
        }
View Full Code Here


      builder.field("centroid", new double[] { centroid.getLongitude(), centroid.getLatitude() });
      builder.field("lengthKm", shape.getLengthKm());
      builder.field("areaKm2", shape.getAreaKm2());
      builder.startObject("shape");
      builder.field("type", shape.isClosed() ? "polygon" : "linestring");
      builder.startArray("coordinates");
      if (shape.isClosed()) builder.startArray();
      for (double[] location : shape.getGeoJsonArray()) {
        builder.startArray().value(location[0]).value(location[1]).endArray();
      }
      if (shape.isClosed()) builder.endArray();
View Full Code Here

      builder.field("lengthKm", shape.getLengthKm());
      builder.field("areaKm2", shape.getAreaKm2());
      builder.startObject("shape");
      builder.field("type", shape.isClosed() ? "polygon" : "linestring");
      builder.startArray("coordinates");
      if (shape.isClosed()) builder.startArray();
      for (double[] location : shape.getGeoJsonArray()) {
        builder.startArray().value(location[0]).value(location[1]).endArray();
      }
      if (shape.isClosed()) builder.endArray();
      builder.endArray();
View Full Code Here

      builder.startObject("shape");
      builder.field("type", shape.isClosed() ? "polygon" : "linestring");
      builder.startArray("coordinates");
      if (shape.isClosed()) builder.startArray();
      for (double[] location : shape.getGeoJsonArray()) {
        builder.startArray().value(location[0]).value(location[1]).endArray();
      }
      if (shape.isClosed()) builder.endArray();
      builder.endArray();
      builder.endObject();
      builder.field("tags", getTags());
View Full Code Here

    }

    if (commentIndexingMode == CommentIndexingMode.EMBEDDED) {
      List<Map<String, Object>> comments = extractComments(documentRemote);
      if (comments != null && !comments.isEmpty()) {
        out.startArray(indexFieldForComments);
        for (Map<String, Object> comment : comments) {
          out.startObject();
          addCommonFieldsToCommentIndexedDocument(out, documentId, comment);
          out.endObject();
        }
View Full Code Here

      builder.endObject();
    }
    if (coordinatorInstance != null) {
      List<SpaceIndexingInfo> currProjectIndexingInfo = coordinatorInstance.getCurrentSpaceIndexingInfo();
      if (currProjectIndexingInfo != null) {
        builder.startArray("current_indexing");
        for (SpaceIndexingInfo pi : currProjectIndexingInfo) {
          pi.buildDocument(builder, true, false);
        }
        builder.endArray();
      }
View Full Code Here

        builder.endArray();
      }
    }
    List<String> pkeys = getAllIndexedSpaceKeys();
    if (pkeys != null) {
      builder.startArray("indexed_spaces");
      for (String spaceKey : pkeys) {
        builder.startObject();
        builder.field(SpaceIndexingInfo.DOCFIELD_SPACE_KEY, spaceKey);
        SpaceIndexingInfo lastIndexing = getLastSpaceIndexingInfo(spaceKey);
        if (lastIndexing != null) {
View Full Code Here

                        builder.field("source", status.getSource());
                        builder.field("truncated", status.isTruncated());
                        builder.field("language", status.getLang());

                        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());
View Full Code Here

                            }
                            builder.endObject();
                        }

                        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());
View Full Code Here

                        if (status.getContributors() != null && status.getContributors().length > 0) {
                            builder.array("contributor", status.getContributors());
                        }
                        if (status.getGeoLocation() != null) {
                            if (geoAsArray) {
                                builder.startArray("location");
                                builder.value(status.getGeoLocation().getLongitude());
                                builder.value(status.getGeoLocation().getLatitude());
                                builder.endArray();
                            } else {
                                builder.startObject("location");
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.