org.elasticsearch.action.termvectors.MultiTermVectorsResponse Java Examples
The following examples show how to use
org.elasticsearch.action.termvectors.MultiTermVectorsResponse.
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: MoreLikeThisFetchService.java From Elasticsearch with Apache License 2.0 | 5 votes |
public MultiTermVectorsResponse fetchResponse(List<Item> items, SearchContext searchContext) throws IOException { MultiTermVectorsRequest request = new MultiTermVectorsRequest(); for (Item item : items) { request.add(item.toTermVectorsRequest()); } request.copyContextAndHeadersFrom(searchContext); return client.multiTermVectors(request).actionGet(); }
Example #2
Source File: MoreLikeThisFetchService.java From Elasticsearch with Apache License 2.0 | 5 votes |
public static Fields[] getFieldsFor(MultiTermVectorsResponse responses) throws IOException { List<Fields> likeFields = new ArrayList<>(); for (MultiTermVectorsItemResponse response : responses) { if (response.isFailed()) { continue; } TermVectorsResponse getResponse = response.getResponse(); if (!getResponse.isExists()) { continue; } likeFields.add(getResponse.getFields()); } return likeFields.toArray(Fields.EMPTY_ARRAY); }
Example #3
Source File: RestMultiTermVectorsAction.java From Elasticsearch with Apache License 2.0 | 5 votes |
@Override public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception { MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest(); TermVectorsRequest template = new TermVectorsRequest(); template.index(request.param("index")); template.type(request.param("type")); RestTermVectorsAction.readURIParameters(template, request); multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids"))); multiTermVectorsRequest.add(template, RestActions.getRestContent(request)); client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<MultiTermVectorsResponse>(channel)); }
Example #4
Source File: ClientWithStats.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public ActionFuture<MultiTermVectorsResponse> multiTermVectors(MultiTermVectorsRequest request) { return wrapped.multiTermVectors(request); }
Example #5
Source File: ClientWithStats.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public void multiTermVectors(MultiTermVectorsRequest request, ActionListener<MultiTermVectorsResponse> listener) { wrapped.multiTermVectors(request, listener); }
Example #6
Source File: FessEsClient.java From fess with Apache License 2.0 | 4 votes |
@Override public ActionFuture<MultiTermVectorsResponse> multiTermVectors(final MultiTermVectorsRequest request) { return client.multiTermVectors(request); }
Example #7
Source File: FessEsClient.java From fess with Apache License 2.0 | 4 votes |
@Override public void multiTermVectors(final MultiTermVectorsRequest request, final ActionListener<MultiTermVectorsResponse> listener) { client.multiTermVectors(request, listener); }