org.elasticsearch.action.termvectors.MultiTermVectorsRequestBuilder Java Examples

The following examples show how to use org.elasticsearch.action.termvectors.MultiTermVectorsRequestBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientWithStats.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public MultiTermVectorsRequestBuilder prepareMultiTermVectors() {
	return wrapped.prepareMultiTermVectors();
}
 
Example #2
Source File: GenTermValuesHandler.java    From elasticsearch-taste with Apache License 2.0 4 votes vote down vote up
@Override
public void onResponse(final SearchResponse response) {
    if (mTVListener != null) {
        try {
            mTVListener.await();
        } catch (final InterruptedException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Interrupted.", e);
            }
        }
    }

    if (interrupted) {
        return;
    }

    final SearchHits searchHits = response.getHits();
    final SearchHit[] hits = searchHits.getHits();
    if (hits.length == 0) {
        scrollSearchGate.countDown();
        shutdown();
    } else {
        final Map<String, DocInfo> idMap = new HashMap<>(hits.length);
        final MultiTermVectorsRequestBuilder requestBuilder = client
                .prepareMultiTermVectors();
        for (final SearchHit hit : hits) {
            final String id = hit.getId();
            final SearchHitField searchHitField = hit.field(idField);
            if (searchHitField != null) {
                idMap.put(id,
                        new DocInfo((String) searchHitField.getValue(),
                                hit.getSource()));
            }
            final TermVectorsRequest termVectorRequest = new TermVectorsRequest(
                    sourceIndex, sourceType, id);
            termVectorRequest.selectedFields(sourceFields);
            requestBuilder.add(termVectorRequest);
        }
        mTVListener = new MultiTermVectorsListener(numOfThreads,
                requestHandlers, eventParams, idMap, executor, logger);
        requestBuilder.execute(mTVListener);

        client.prepareSearchScroll(response.getScrollId())
                .setScroll(new TimeValue(keepAlive.longValue()))
                .execute(this);
    }
}
 
Example #3
Source File: FessEsClient.java    From fess with Apache License 2.0 4 votes vote down vote up
@Override
public MultiTermVectorsRequestBuilder prepareMultiTermVectors() {
    return client.prepareMultiTermVectors();
}