org.apache.nutch.searcher
Class IndexSearcher

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

public class IndexSearcher
extends Object
implements Searcher, HitDetailer

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


Constructor Summary
IndexSearcher(Path[] indexDirs, Configuration conf)
          Construct given a number of indexes.
IndexSearcher(Path index, Configuration conf)
          Construct given a single merged index.
 
Method Summary
 void close()
           
 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)
          Return the top-scoring hits for a query.
 Hits search(Query query, int numHits, String dedupField, String sortField, boolean reverse)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSearcher

public IndexSearcher(Path[] indexDirs,
                     Configuration conf)
              throws IOException
Construct given a number of indexes.

Throws:
IOException

IndexSearcher

public IndexSearcher(Path index,
                     Configuration conf)
              throws IOException
Construct given a single merged index.

Throws:
IOException
Method Detail

search

@Deprecated
public Hits search(Query query,
                              int numHits,
                              String dedupField,
                              String sortField,
                              boolean reverse)
            throws IOException
Deprecated. 

Description copied from interface: Searcher
Return the top-scoring hits for a query.

Specified by:
search in interface Searcher
Throws:
IOException

search

public Hits search(Query query)
            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

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2006 The Apache Software Foundation