当前位置: 首页>>代码示例>>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;未经允许,请勿转载。