2 * Copyright 2004 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 namespace Lucene
.Net
.Search
19 /// <summary>Lower-level search API.</summary>
20 /// <seealso cref="Searcher#Search(Query,HitCollector)">
22 /// <version> $Id: HitCollector.cs,v 1.2 2005/01/17 19:54:30 joeshaw Exp $
24 public abstract class HitCollector
26 /// <summary>Called once for every non-zero scoring document, with the document number
29 /// <P>If, for example, an application wished to collect all of the hits for a
30 /// query in a BitSet, then it might:<pre>
31 /// Searcher searcher = new IndexSearcher(indexReader);
32 /// final BitSet bits = new BitSet(indexReader.maxDoc());
33 /// searcher.search(query, new HitCollector() {
34 /// public void collect(int doc, float score) {
40 /// <p>Note: This is called in an inner search loop. For good search
41 /// performance, implementations of this method should not call
42 /// {@link Searcher#Doc(int)} or
43 /// {@link Lucene.Net.Index.IndexReader#Document(int)} on every
44 /// document number encountered. Doing so can slow searches by an order
45 /// of magnitude or more.
46 /// <p>Note: The <code>score</code> passed to this method is a raw score.
47 /// In other words, the score will not necessarily be a float whose value is
50 public abstract void Collect(int doc
, float score
);