本文整理匯總了Java中org.apache.solr.response.SolrQueryResponse.setAllValues方法的典型用法代碼示例。如果您正苦於以下問題:Java SolrQueryResponse.setAllValues方法的具體用法?Java SolrQueryResponse.setAllValues怎麽用?Java SolrQueryResponse.setAllValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.solr.response.SolrQueryResponse
的用法示例。
在下文中一共展示了SolrQueryResponse.setAllValues方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleRequestBody
import org.apache.solr.response.SolrQueryResponse; //導入方法依賴的package包/類
@Override
public void handleRequestBody(
final SolrQueryRequest request,
final SolrQueryResponse response) throws Exception {
final SolrParams params = request.getParams();
response.setAllValues(
chain.stream()
.map(refName -> { return requestHandler(request, refName); })
.filter(SearchHandler.class::isInstance)
.map(handler -> { return executeQuery(request, response, params, handler); })
.filter(qresponse -> howManyFound(qresponse) > 0)
.findFirst()
.orElse(emptyResponse(request, response)));
}
開發者ID:spaziocodice,項目名稱:invisible-queries-request-handler,代碼行數:16,代碼來源:InvisibleQueriesRequestHandler.java
示例2: request
import org.apache.solr.response.SolrQueryResponse; //導入方法依賴的package包/類
private SolrQueryRequest request(ModifiableSolrParams params, String handlerName) {
SolrCore core = h.getCore();
SolrRequestHandler handler = core.getRequestHandler(handlerName);
SolrQueryResponse rsp = new SolrQueryResponse();
NamedList<Object> list = new NamedList<Object>();
list.add("responseHeader", new SimpleOrderedMap<Object>());
rsp.setAllValues(list);
SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
handler.handleRequest(req, rsp);
return req;
}
示例3: request
import org.apache.solr.response.SolrQueryResponse; //導入方法依賴的package包/類
private SolrQueryRequest request(ModifiableSolrParams params) {
SolrCore core = h.getCore();
SolrRequestHandler handler = core.getRequestHandler(CENTROID_REQUEST_HANDLER);
SolrQueryResponse rsp = new SolrQueryResponse();
NamedList<Object> list = new NamedList<Object>();
list.add("responseHeader", new SimpleOrderedMap<Object>());
rsp.setAllValues(list);
SolrQueryRequest req = new LocalSolrQueryRequest(core, params);
handler.handleRequest(req, rsp);
return req;
}
示例4: serializeResponse
import org.apache.solr.response.SolrQueryResponse; //導入方法依賴的package包/類
private InputStream serializeResponse(SolrParams params, QueryResponse response) throws IOException {
LocalSolrQueryRequest solrQueryRequest = new LocalSolrQueryRequest(null, params);
SolrQueryResponse solrQueryResponse = new SolrQueryResponse();
solrQueryResponse.setAllValues(response.getResponse());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-8");
this.jsonResponseWriter.write(writer, solrQueryRequest, solrQueryResponse);
writer.flush();
return new ByteArrayInputStream(baos.toByteArray());
}