/// <summary>Lower-level search API. /// /// <p/><see cref="Collector.Collect(int)" /> is called for every matching document. /// /// <p/>Applications should only use this if they need <i>all</i> of the /// matching documents. The high-level search API (<see cref="Searcher.Search(Query, int)" />) /// is usually more efficient, as it skips /// non-high-scoring hits. /// <p/>This method cannot be parallelized, because <see cref="Collector"/> /// supports no concurrent access. /// </summary> /// <param name="weight">to match documents /// </param> /// <param name="filter">if non-null, a bitset used to eliminate some documents /// </param> /// <param name="collector">to receive hits /// /// TODO: parallelize this one too /// </param> public override void Search(Weight weight, Filter filter, Collector collector, IState state) { for (int i = 0; i < searchables.Length; i++) { int start = starts[i]; Collector hc = new AnonymousClassCollector1(collector, start, this); searchables[i].Search(weight, filter, hc, state); } }
/// <summary>Lower-level search API. /// /// <p/><see cref="Collector.Collect(int)" /> is called for every matching document. /// /// <p/>Applications should only use this if they need <i>all</i> of the /// matching documents. The high-level search API (<see cref="Searcher.Search(Query, int)" />) /// is usually more efficient, as it skips /// non-high-scoring hits. /// <p/>This method cannot be parallelized, because <see cref="Collector"/> /// supports no concurrent access. /// </summary> /// <param name="weight">to match documents /// </param> /// <param name="filter">if non-null, a bitset used to eliminate some documents /// </param> /// <param name="collector">to receive hits /// /// TODO: parallelize this one too /// </param> public override void Search(Weight weight, Filter filter, Collector collector) { for (int i = 0; i < searchables.Length; i++) { int start = starts[i]; Collector hc = new AnonymousClassCollector1(collector, start, this); searchables[i].Search(weight, filter, hc); } }