Example #1
0
 /// <summary>Scores all documents and passes them to a collector. </summary>
 public virtual void  Score(HitCollector hc)
 {
     while (Next())
     {
         hc.Collect(Doc(), Score());
     }
 }
Example #2
0
		/// <summary>Scores all documents and passes them to a collector. </summary>
		public virtual void  Score(HitCollector hc)
		{
			while (Next())
			{
				hc.Collect(Doc(), Score());
			}
		}
Example #3
0
 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));
            }
        }
Example #5
0
			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;
			}
Example #6
0
        // 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);
        }
Example #7
0
 /// <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);
		}
Example #9
0
		// 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));
			}
		}
Example #10
0
		/// <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);
		}
Example #11
0
		public virtual void  Search(Query query, Filter filter, HitCollector results)
		{
			local.Search(query, filter, results);
		}
Example #12
0
 public virtual void  Search(Query query, Filter filter, HitCollector results)
 {
     local.Search(query, filter, results);
 }