org.apache.nutch.searcher
Class IndexSearcher

java.lang.Object
  extended byorg.apache.nutch.searcher.IndexSearcher
All Implemented Interfaces:
HitDetailer, Searcher

public class IndexSearcher
extends Object
implements Searcher, HitDetailer

Implements Searcher and HitDetailer for either a single merged index, or for a set of individual segment indexes.


Constructor Summary
IndexSearcher(File[] segmentDirs)
          Construct given a number of indexed segments.
IndexSearcher(String index)
          Construct given a directory containing fetched segments, and a separate directory naming their merged index.
 
Method Summary
 HitDetails getDetails(Hit hit)
          Returns the details for a hit document.
 HitDetails[] getDetails(Hit[] hits)
          Returns the details for a set of hits.
 String getExplanation(Query query, Hit hit)
          Return an HTML-formatted explanation of how a query scored.
 Hits search(Query query, int numHits, String dedupField, String sortField, boolean reverse)
          Return the top-scoring hits for a query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSearcher

public IndexSearcher(File[] segmentDirs)
              throws IOException
Construct given a number of indexed segments.


IndexSearcher

public IndexSearcher(String index)
              throws IOException
Construct given a directory containing fetched segments, and a separate directory naming their merged index.

Method Detail

search

public Hits search(Query query,
                   int numHits,
                   String dedupField,
                   String sortField,
                   boolean reverse)
            throws IOException
Description copied from interface: Searcher
Return the top-scoring hits for a query.

Specified by:
search in interface Searcher
Throws:
IOException

getExplanation

public String getExplanation(Query query,
                             Hit hit)
                      throws IOException
Description copied from interface: Searcher
Return an HTML-formatted explanation of how a query scored.

Specified by:
getExplanation in interface Searcher
Throws:
IOException

getDetails

public HitDetails getDetails(Hit hit)
                      throws IOException
Description copied from interface: HitDetailer
Returns the details for a hit document.

Specified by:
getDetails in interface HitDetailer
Throws:
IOException

getDetails

public HitDetails[] getDetails(Hit[] hits)
                        throws IOException
Description copied from interface: HitDetailer
Returns the details for a set of hits. Hook for parallel IPC calls.

Specified by:
getDetails in interface HitDetailer
Throws:
IOException


Copyright © 2006 The Apache Software Foundation