org.apache.nutch.searcher
Class LuceneSearchBean

java.lang.Object
  extended by org.apache.nutch.searcher.LuceneSearchBean
All Implemented Interfaces:
Closeable, VersionedProtocol, HitDetailer, RPCSearchBean, SearchBean, Searcher

public class LuceneSearchBean
extends Object
implements RPCSearchBean


Field Summary
static long VERSION
           
 
Fields inherited from interface org.apache.nutch.searcher.SearchBean
LOG
 
Constructor Summary
LuceneSearchBean(Configuration conf, Path indexDir, Path indexesDir)
          Construct in a named directory.
 
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.
 long getProtocolVersion(String protocol, long clientVersion)
           
 boolean ping()
           
 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
 

Field Detail

VERSION

public static final long VERSION
See Also:
Constant Field Values
Constructor Detail

LuceneSearchBean

public LuceneSearchBean(Configuration conf,
                        Path indexDir,
                        Path indexesDir)
                 throws IOException
Construct in a named directory.

Parameters:
conf -
dir -
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

ping

public boolean ping()
             throws IOException
Specified by:
ping in interface SearchBean
Throws:
IOException

close

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

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Specified by:
getProtocolVersion in interface VersionedProtocol
Throws:
IOException


Copyright © 2006 The Apache Software Foundation