Build bulk index request builder bulk request builder.

@param indexRequestBuilderList the index request builder list
@return the bulk request builder
349171
public BulkRequestBuilder buildBulkIndexRequestBuilder(
            List<IndexRequestBuilder> indexRequestBuilderList) {
        BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
        for (IndexRequestBuilder indexRequestBuilder : indexRequestBuilderList)
            bulkRequestBuilder.add(indexRequestBuilder);
        return bulkRequestBuilder;
    }
965081
public BulkRequestBuilder buildDeleteBulkRequestBuilder(
            List<DeleteRequestBuilder> deleteRequestBuilderList) {
        BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
        for (DeleteRequestBuilder deleteRequestBuilder : deleteRequestBuilderList)
            bulkRequestBuilder.add(deleteRequestBuilder);
        return bulkRequestBuilder;
    }
450879
static SearchRequestBuilder applyAliasMetadata(EsMajorVersion version,
                                                   Map<String, IndicesAliases.Alias> aliases,
                                                   SearchRequestBuilder searchRequestBuilder,
                                                   String index, String... indicesOrAliases) {
        if (QueryUtils.isExplicitlyRequested(index, indicesOrAliases)) {
            return searchRequestBuilder;
        }

        Set<String> routing = new HashSet<String>();
        List<QueryBuilder> aliasFilters = new ArrayList<QueryBuilder>();
        for (IndicesAliases.Alias alias : aliases.values()) {
            if (QueryUtils.isExplicitlyRequested(alias.getName(), indicesOrAliases)) {
                // The alias is explicitly requested
                if (StringUtils.hasLength(alias.getSearchRouting())) {
                    for (String value : alias.getSearchRouting().split(",")) {
                        routing.add(value.trim());
                    }
                }
                if (alias.getFilter() != null) {
                    try {
                        aliasFilters.add(new RawQueryBuilder(alias.getFilter(), false));
                    } catch (IOException e) {
                        throw new EsHadoopIllegalArgumentException("Failed to parse alias filter: [" + alias.getFilter() + "]");
                    }
                }
            }
        }
        if (aliasFilters.size() > 0) {
            QueryBuilder aliasQuery;
            if (aliasFilters.size() == 1) {
                aliasQuery = aliasFilters.get(0);
            } else {
                aliasQuery = new BoolQueryBuilder();
                for (QueryBuilder filter : aliasFilters) {
                    ((BoolQueryBuilder) aliasQuery).should(filter);
                }
            }
            if (searchRequestBuilder.query() == null) {
                searchRequestBuilder.query(aliasQuery);
            } else {
                BoolQueryBuilder mainQuery = new BoolQueryBuilder();
                mainQuery.must(searchRequestBuilder.query());
                if (version.after(EsMajorVersion.V_1_X)) {
                    mainQuery.filter(aliasQuery);
                } else {
                    mainQuery.must(new ConstantScoreQueryBuilder().filter(aliasQuery).boost(0.0f));
                }
                searchRequestBuilder.query(mainQuery);
            }
        }
        if (routing.size() > 0) {
            searchRequestBuilder.routing(StringUtils.concatenate(routing, ","));
        }
        return searchRequestBuilder;
    }
626571
public Builder toBuilder() {
    return newBuilder()
        .setMaxAgeSeconds(maxAgeSeconds)
        .setMethods(methods)
        .setOrigins(origins)
        .setResponseHeaders(responseHeaders);
  }
778096
public java.util.List<? extends com.google.javascript.jscomp.RequirementOrBuilder> 
      getRequirementOrBuilderList() {
    return requirement_;
  }
1314263
public BulkResponse deleteBulkDocs(String index, String type,
            QueryBuilder filterQueryBuilder) {
        return executeBulkRequest(buildDeleteBulkRequestBuilder(
                buildExtractDeleteRequestBuilderList(index, type,
                        filterQueryBuilder)));
    }
822921
public com.google.appengine.v1.InstanceOrBuilder getInstancesOrBuilder(
      int index) {
    return instances_.get(index);
  }
294842
@Override
	protected List<IndexRequestBuilder> toRequest(JCas jCas, Client client,
			String indexName) throws IOException {
		List<IndexRequestBuilder> requests = newArrayList();

		String pmId = getHeaderDocId(jCas);

		try {
			// UIMA CAS indexes so that we build them once for all sentences.
			Map<AnnotationFS, Collection<AnnotationFS>> idxNeuron = indexCovered(
					jCas.getCas(), //
					getType(jCas, Sentence.class), getType(jCas, Neuron.class));
			Map<AnnotationFS, Collection<AnnotationFS>> idxNeuronProperties = indexCovered(
					jCas.getCas(), //
					getType(jCas, Neuron.class),
					getType(jCas, NeuronProperty.class));
			Map<AnnotationFS, Collection<AnnotationFS>> idxNeurons = indexCovered(
					jCas.getCas(), //
					getType(jCas, Neuron.class),
					getType(jCas, NeuronTrigger.class));

			for (Sentence s : select(jCas, Sentence.class)) {

				// only index sentences that contain a neuron
				if (!(onlyIndexNeurons && idxNeuron.get(s).isEmpty())) {

					int sentenceStart = s.getBegin();

					final XContentBuilder doc = jsonBuilder().startObject();
					doc.field(FIELD_PUBMED_ID, pmId);
					doc.field(FIELD_SENTENCE_TEXT, s.getCoveredText());
					doc.field(FIELD_SENTENCE_ID, sentenceStart);

					doc.startArray("neuron");

					for (AnnotationFS nwp_ : idxNeuron.get(s)) {
						Neuron nwp = (Neuron) nwp_;
						doc.startObject();
						doc.field(FIELD_NEURON_TEXT, nwp.getCoveredText());
						doc.field(FIELD_START, nwp.getBegin() - sentenceStart);
						doc.field(FIELD_END, nwp.getEnd() - sentenceStart);

						// properties
						doc.startArray("neuron_properties");
						// neuron(trigger), handle as it were a property
						NeuronTrigger n = ((NeuronTrigger) (idxNeurons.get(nwp)
								.iterator().next()));
						doc.startObject();
						doc.field(FIELD_NEURON_TYPE, n.getType().getShortName()
								.replaceAll("Prop$", ""));
						doc.field(FIELD_PROPERTY_TEXT, n.getCoveredText());
						doc.field(FIELD_START, n.getBegin() - sentenceStart);
						doc.field(FIELD_END, n.getEnd() - sentenceStart);
						doc.endObject(); // end 'n' (neuron trigger)

						// every NeuronProperty
						if (idxNeuronProperties.containsKey(nwp)) {
							for (AnnotationFS np : idxNeuronProperties.get(nwp)) {
								doc.startObject();
								doc.field(FIELD_NEURON_TYPE, np.getType()
										.getShortName().replaceAll("Prop$", ""));
								doc.field(FIELD_PROPERTY_TEXT,
										np.getCoveredText());
								doc.field(FIELD_START, np.getBegin()
										- sentenceStart);
								doc.field(FIELD_END, np.getEnd()
										- sentenceStart);
								doc.endObject();
							}
						}
						doc.endArray(); // end 'properties'
						doc.endObject(); // end nwp
					}
					doc.endArray(); // end 'neuron'

					String uid = pmId + "_" + sentenceStart; // uid for Lucene
					requests.add(client
							.prepareIndex(indexName, "sentence", uid)
							.setSource(doc));

					LOG.trace(doc.string());
				}
			}
		} catch (Exception e) {
			LOG.warn("could not index pmid" + pmId, e);
		}
		return requests;
	}
301739
public BulkResponse
    executeBulkRequest(BulkRequestBuilder bulkRequestBuilder) {
        JMLog.info(log, "executeBulkRequest", bulkRequestBuilder);
        return bulkRequestBuilder.execute().actionGet();
    }
1156414
public GetRequestBuilder<T,ID> find(ID... ids)
    {
        return new GetRequestBuilder<T, ID>(version,type,entityName,ids);
    }
797321
public static OffsetPaginatedListMetadata.Builder builder() {
    return new AutoValue_OffsetPaginatedListMetadata.Builder()
        .offsetFieldName(OffsetParameter.getDefaultOffsetFieldName())
        .limitFieldName(LimitParameter.getDefaultLimitFieldName());
  }
692515
public void sendWithBulkProcessorAndObjectMapper(List<Object> bulkObject,
            String index, String type) {
        sendWithBulkProcessor(bulkObject.stream()
                .map(sourceObject -> buildIndexRequest(index, type, null)
                        .source(JMElasticsearchUtil
                                .buildSourceByJsonMapper(sourceObject)))
                .collect(toList()));
    }
482877
@SuppressWarnings("unchecked")
  protected AppendRequest buildAppendEntriesRequest(RaftMemberContext member, long lastIndex) {
    final RaftLogReader reader = member.getLogReader();

    final Indexed<RaftLogEntry> prevEntry = reader.getCurrentEntry();

    final DefaultRaftMember leader = raft.getLeader();
    AppendRequest.Builder builder = AppendRequest.builder()
        .withTerm(raft.getTerm())
        .withLeader(leader != null ? leader.memberId() : null)
        .withPrevLogIndex(prevEntry != null ? prevEntry.index() : reader.getFirstIndex() - 1)
        .withPrevLogTerm(prevEntry != null ? prevEntry.entry().term() : 0)
        .withCommitIndex(raft.getCommitIndex());

    // Build a list of entries to send to the member.
    final List<RaftLogEntry> entries = new ArrayList<>();

    // Build a list of entries up to the MAX_BATCH_SIZE. Note that entries in the log may
    // be null if they've been compacted and the member to which we're sending entries is just
    // joining the cluster or is otherwise far behind. Null entries are simply skipped and not
    // counted towards the size of the batch.
    // If there exists an entry in the log with size >= MAX_BATCH_SIZE the logic ensures that
    // entry will be sent in a batch of size one
    int size = 0;

    // Iterate through the log until the last index or the end of the log is reached.
    while (reader.hasNext()) {
      // Otherwise, read the next entry and add it to the batch.
      Indexed<RaftLogEntry> entry = reader.next();
      entries.add(entry.entry());
      size += entry.size();
      if (entry.index() == lastIndex || size >= MAX_BATCH_SIZE) {
        break;
      }
    }

    // Add the entries to the request builder and build the request.
    return builder.withEntries(entries).build();
  }
1098115
public Builder getResource(String queryUrl) throws Exception {
    if (debug)
      LOGGER.log(Level.INFO, queryUrl);
    WebResource wrs = client.resource(queryUrl);
    Builder result = wrs.header("USER-AGENT", USER_AGENT);
    return result;
  }
555942
public function createQueryBuilder($alias, $indexBy = null)
    {
        $qb = $this->repository->createQueryBuilder($alias, $indexBy);

        $this->applySecurityModel($qb, $alias);

        return $qb;
    }
658198
public TermsByQueryRequest query(XContentBuilder builder) {
    this.querySource = builder == null ? null : builder.bytes();
    return this;
  }
1057426
public QueryBuilder useIndex(String designDocument, String indexName) {
        useIndex = new String[]{designDocument, indexName};
        return this;
    }