/// <summary>Scores all documents and passes them to a collector. </summary> public virtual void Score(HitCollector hc) { while (Next()) { hc.Collect(Doc(), Score()); } }
public SubScorer(Scorer scorer, bool required, bool prohibited, HitCollector collector, SubScorer next) { this.scorer = scorer; this.done = !scorer.Next(); this.required = required; this.prohibited = prohibited; this.collector = collector; this.next = next; }
/// <summary>Lower-level search API. /// /// <p>{@link HitCollector#Collect(int,float)} is called for every non-zero /// scoring document. /// /// <p>Applications should only use this if they need <i>all</i> of the /// matching documents. The high-level search API ({@link /// Searcher#Search(Query)}) is usually more efficient, as it skips /// non-high-scoring hits. /// /// </summary> /// <param name="query">to match documents /// </param> /// <param name="filter">if non-null, a bitset used to eliminate some documents /// </param> /// <param name="results">to receive hits /// /// TODO: parallelize this one too /// </param> public override void Search(Query query, Filter filter, HitCollector results) { for (int i = 0; i < searchables.Length; i++) { int start = starts[i]; searchables[i].Search(query, filter, new AnonymousClassHitCollector1(results, start, this)); } }
// inherit javadoc public override void Search(Query query, Filter filter, HitCollector results) { HitCollector collector = results; if (filter != null) { System.Collections.BitArray bits = filter.Bits(reader); collector = new AnonymousClassHitCollector2(bits, results, this); } Scorer scorer = query.Weight(this).Scorer(reader); if (scorer == null) { return; } scorer.Score(collector); }
/// <summary>Lower-level search API. /// /// <p>{@link HitCollector#Collect(int,float)} is called for every non-zero /// scoring document. /// /// <p>Applications should only use this if they need <i>all</i> of the /// matching documents. The high-level search API ({@link /// Searcher#Search(Query)}) is usually more efficient, as it skips /// non-high-scoring hits. /// <p>Note: The <code>score</code> passed to this method is a raw score. /// In other words, the score will not necessarily be a float whose value is /// between 0 and 1. /// </summary> public virtual void Search(Query query, HitCollector results) { Search(query, (Filter)null, results); }
// inherit javadoc public override void Search(Query query, Filter filter, HitCollector results) { HitCollector collector = results; if (filter != null) { System.Collections.BitArray bits = filter.Bits(reader); collector = new AnonymousClassHitCollector2(bits, results, this); } Scorer scorer = query.Weight(this).Scorer(reader); if (scorer == null) return ; scorer.Score(collector); }
// inherit javadoc public override void Search(Query query, Filter filter, HitCollector results) { for (int i = 0; i < searchables.Length; i++) { int start = starts[i]; searchables[i].Search(query, filter, new AnonymousClassHitCollector(results, start, this)); } }
/// <summary>Lower-level search API. /// /// <p>{@link HitCollector#Collect(int,float)} is called for every non-zero /// scoring document. /// /// <p>Applications should only use this if they need <i>all</i> of the /// matching documents. The high-level search API ({@link /// Searcher#Search(Query)}) is usually more efficient, as it skips /// non-high-scoring hits. /// <p>Note: The <code>score</code> passed to this method is a raw score. /// In other words, the score will not necessarily be a float whose value is /// between 0 and 1. /// </summary> public virtual void Search(Query query, HitCollector results) { Search(query, (Filter) null, results); }
public virtual void Search(Query query, Filter filter, HitCollector results) { local.Search(query, filter, results); }