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


Java QueryResponse.getNextCursorMark方法代碼示例

本文整理匯總了Java中org.apache.solr.client.solrj.response.QueryResponse.getNextCursorMark方法的典型用法代碼示例。如果您正苦於以下問題:Java QueryResponse.getNextCursorMark方法的具體用法?Java QueryResponse.getNextCursorMark怎麽用?Java QueryResponse.getNextCursorMark使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.solr.client.solrj.response.QueryResponse的用法示例。


在下文中一共展示了QueryResponse.getNextCursorMark方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processQuery

import org.apache.solr.client.solrj.response.QueryResponse; //導入方法依賴的package包/類
private void processQuery(SolrQuery query, WorkLog workLog) throws SolrServerException, IOException {
  log.debug("Query for rule : {}", query.toString());
  Timer.Context context = getTimer(getName() + ".processQuery").time();
  // need to commit here so that we can ignore documents just processed
  client.commit();

  boolean more = true;
  String cursor = CursorMarkParams.CURSOR_MARK_START;
  while (more) {
    query.set(CursorMarkParams.CURSOR_MARK_PARAM, cursor);
    Timer.Context contextQuery = getTimer(getName() + ".query").time();

    QueryResponse response = client.query(query);
    workLog.ranSearch();
    SolrDocumentList results = response.getResults();
    log.debug("Found {} (of {} docs) in QT = {} ms", results.size(), results.getNumFound(), response.getQTime());
    String nextCursor = response.getNextCursorMark();
    if (nextCursor == null || cursor.equals(nextCursor)) {
      more = false;
    }
    distributeResponse(results, workLog);
    cursor = nextCursor;
    contextQuery.stop();
  }

  // We do this at a higher level too, so this would seem redundant. There is a trade-off. Allowing parallelism
  // between rules means rules can sometimes be re-processed redundantly. The higher level waitUntilCaughtUp() will
  // ensure we never process rules at the same time rules are being changed.
  // By doing a wait here as well however, we can collect accurate statistics about how much actual write activity we
  // are really generating by passing the workLog into the work pool.
  // When we have a better awareness of the typical work patterns it might be worth disabling this method call and
  // then stop collecting the metrics to improve throughput.
  waitUntilCaughtUp();
  context.stop();
}
 
開發者ID:nla,項目名稱:bamboo,代碼行數:36,代碼來源:RuleChangeUpdateManager.java

示例2: updateCursorMark

import org.apache.solr.client.solrj.response.QueryResponse; //導入方法依賴的package包/類
private void updateCursorMark(QueryResponse response) {
  if (cursorMark.equals(response.getNextCursorMark())) {
    done = true;
  }
  cursorMark = response.getNextCursorMark();
}
 
開發者ID:apache,項目名稱:beam,代碼行數:7,代碼來源:SolrIO.java

示例3: assertHashNextCursorMark

import org.apache.solr.client.solrj.response.QueryResponse; //導入方法依賴的package包/類
/**
 * Given a QueryResponse returned by SolrServer.query, asserts that the
 * response does include {@link #CURSOR_MARK_NEXT} key and returns it
 * @see SolrServer#query
 */
private String assertHashNextCursorMark(QueryResponse rsp) {
  String r = rsp.getNextCursorMark();
  assertNotNull(CURSOR_MARK_NEXT+" is null/missing", r);
  return r;
}
 
開發者ID:europeana,項目名稱:search,代碼行數:11,代碼來源:DistribCursorPagingTest.java


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