The TimeLimitingCollector is used to timeout search requests that take longer than the maximum allowed search time limit. After this time is exceeded, the search thread is stopped by throwing a TimeExceededException.
Inheritance: Collector
コード例 #1
0
		private Collector CreateTimedCollector(MyHitCollector hc, long timeAllowed, bool greedy)
		{
			TimeLimitingCollector res = new TimeLimitingCollector(hc, timeAllowed);
			res.IsGreedy = greedy; // set to true to make sure at least one doc is collected.
			return res;
		}