當前位置: 首頁>>代碼示例>>Java>>正文


Java SolrQueryResponse.setAllValues方法代碼示例

本文整理匯總了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;
}
 
開發者ID:sematext,項目名稱:query-segmenter,代碼行數:13,代碼來源:QuerySegmenterComponentTest.java

示例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;
}
 
開發者ID:sematext,項目名稱:query-segmenter,代碼行數:13,代碼來源:CentroidComponentTest.java

示例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());
}
 
開發者ID:Indoqa,項目名稱:logspace,代碼行數:13,代碼來源:SolrNativeQueryService.java


注:本文中的org.apache.solr.response.SolrQueryResponse.setAllValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。