本文整理匯總了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();
}
示例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();
}
示例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;
}