FileDocCategorySizeDatePackage
Searcher.javaAPI DocApache Lucene 1.4.32935Tue Mar 30 00:48:04 BST 2004org.apache.lucene.search

Searcher

public abstract class Searcher extends Object implements Searchable
An abstract base class for search implementations. Implements some common utility methods.

Fields Summary
private Similarity
similarity
The Similarity implementation used by this searcher.
Constructors Summary
Methods Summary
public org.apache.lucene.search.SimilaritygetSimilarity()
Expert: Return the Similarity implementation used by this Searcher.

This defaults to the current value of {@link Similarity#getDefault()}.

    return this.similarity;
  
public final org.apache.lucene.search.Hitssearch(org.apache.lucene.search.Query query)
Returns the documents matching query.

    return search(query, (Filter)null);
  
public org.apache.lucene.search.Hitssearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter)
Returns the documents matching query and filter.

    return new Hits(this, query, filter);
  
public org.apache.lucene.search.Hitssearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort)
Returns documents matching query sorted by sort.

    return new Hits(this, query, null, sort);
  
public org.apache.lucene.search.Hitssearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.Sort sort)
Returns documents matching query and filter, sorted by sort.

    return new Hits(this, query, filter, sort);
  
public voidsearch(org.apache.lucene.search.Query query, org.apache.lucene.search.HitCollector results)
Lower-level search API.

{@link HitCollector#collect(int,float)} is called for every non-zero scoring document.

Applications should only use this if they need all of the matching documents. The high-level search API ({@link Searcher#search(Query)}) is usually more efficient, as it skips non-high-scoring hits.

Note: The score 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.

    search(query, (Filter)null, results);
  
public voidsetSimilarity(org.apache.lucene.search.Similarity similarity)
Expert: Set the Similarity implementation used by this Searcher.

see
Similarity#setDefault(Similarity)


                
      
    this.similarity = similarity;