net.nutch.searcher
Class DistributedSearch.Client

java.lang.Object
  extended bynet.nutch.ipc.Client
      extended bynet.nutch.searcher.DistributedSearch.Client
All Implemented Interfaces:
HitContent, HitDetailer, HitSummarizer, Searcher
Enclosing class:
DistributedSearch

public static class DistributedSearch.Client
extends Client
implements Searcher, HitDetailer, HitSummarizer, HitContent

The search client.


Field Summary
 
Fields inherited from class net.nutch.ipc.Client
LOG
 
Constructor Summary
DistributedSearch.Client(File file)
          Construct a client talking to servers listed in the named file.
DistributedSearch.Client(InetSocketAddress[] addresses)
          Construct a client talking to the named servers.
 
Method Summary
 String[] getAnchors(HitDetails hit)
          Returns the anchors of a hit document.
 byte[] getContent(HitDetails hit)
          Returns the content of a hit document.
 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.
 ParseData getParseData(HitDetails hit)
          Returns the ParseData of a hit document.
 String[] getSegmentNames()
          Return the names of segments searched.
 String[] getSummary(HitDetails[] hits, Query query)
          Returns summaries for a set of details.
 String getSummary(HitDetails hit, Query query)
          Returns a summary for the given hit details.
static void main(String[] args)
           
 Hits search(Query query, int numHits)
          Return the top-scoring hits for a query.
 
Methods inherited from class net.nutch.ipc.Client
call, call, setTimeout, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedSearch.Client

public DistributedSearch.Client(File file)
                         throws IOException
Construct a client talking to servers listed in the named file. Each line in the file lists a server hostname and port, separated by whitespace.


DistributedSearch.Client

public DistributedSearch.Client(InetSocketAddress[] addresses)
                         throws IOException
Construct a client talking to the named servers.

Method Detail

getSegmentNames

public String[] getSegmentNames()
Return the names of segments searched.


search

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

getSummary

public String getSummary(HitDetails hit,
                         Query query)
                  throws IOException
Description copied from interface: HitSummarizer
Returns a summary for the given hit details.

Specified by:
getSummary in interface HitSummarizer
Parameters:
hit - the details of the hit to be summarized
query - indicates what should be higlighted in the summary text
Throws:
IOException

getSummary

public String[] getSummary(HitDetails[] hits,
                           Query query)
                    throws IOException
Description copied from interface: HitSummarizer
Returns summaries for a set of details. Hook for parallel IPC calls.

Specified by:
getSummary in interface HitSummarizer
Parameters:
hits - the details of hits to be summarized
query - indicates what should be higlighted in the summary text
Throws:
IOException

getContent

public byte[] getContent(HitDetails hit)
                  throws IOException
Description copied from interface: HitContent
Returns the content of a hit document.

Specified by:
getContent in interface HitContent
Throws:
IOException

getParseData

public ParseData getParseData(HitDetails hit)
                       throws IOException
Description copied from interface: HitContent
Returns the ParseData of a hit document.

Specified by:
getParseData in interface HitContent
Throws:
IOException

getAnchors

public String[] getAnchors(HitDetails hit)
                    throws IOException
Description copied from interface: HitContent
Returns the anchors of a hit document.

Specified by:
getAnchors in interface HitContent
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2004 The Nutch Organization.