|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.nutch.searcher.NutchBean
public class NutchBean
One stop shopping for search-related functionality.
| Nested Class Summary | |
|---|---|
static class |
NutchBean.NutchBeanConstructor
Responsible for constructing a NutchBean singleton instance and caching it in the servlet context. |
| Field Summary | |
|---|---|
static String |
KEY
|
static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
NutchBean(org.apache.hadoop.conf.Configuration conf)
|
|
NutchBean(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path dir)
Construct in a named directory. |
|
| Method Summary | |
|---|---|
void |
close()
|
static NutchBean |
get(javax.servlet.ServletContext app,
org.apache.hadoop.conf.Configuration conf)
Returns the cached instance in the servlet context. |
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. |
long |
getFetchDate(HitDetails hit)
Returns the fetch date of a hit document. |
Inlinks |
getInlinks(HitDetails hit)
Return the inlinks of a hit document. |
ParseData |
getParseData(HitDetails hit)
Returns the ParseData of a hit document. |
ParseText |
getParseText(HitDetails hit)
Returns the ParseText of a hit document. |
long |
getProtocolVersion(String className,
long arg1)
|
String[] |
getSegmentNames()
The name of the segments searched by this node. |
Summary[] |
getSummary(HitDetails[] hits,
Query query)
Returns summaries for a set of details. |
Summary |
getSummary(HitDetails hit,
Query query)
Returns a summary for the given hit details. |
static void |
main(String[] args)
For debugging. |
Hits |
search(Query query,
int numHits)
|
Hits |
search(Query query,
int numHits,
int maxHitsPerDup)
Search for pages matching a query, eliminating excessive hits from the same site. |
Hits |
search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField)
Search for pages matching a query, eliminating excessive hits with matching values for a named field. |
Hits |
search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField,
String sortField,
boolean reverse)
Search for pages matching a query, eliminating excessive hits with matching values for a named field. |
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 |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
public static final String KEY
| Constructor Detail |
|---|
public NutchBean(org.apache.hadoop.conf.Configuration conf)
throws IOException
conf -
IOException
public NutchBean(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path dir)
throws IOException
conf - dir -
IOException| Method Detail |
|---|
public static NutchBean get(javax.servlet.ServletContext app,
org.apache.hadoop.conf.Configuration conf)
throws IOException
IOExceptionNutchBean.NutchBeanConstructorpublic String[] getSegmentNames()
DistributedSearch.Protocol
getSegmentNames in interface DistributedSearch.Protocol
public Hits search(Query query,
int numHits)
throws IOException
IOException
public Hits search(Query query,
int numHits,
String dedupField,
String sortField,
boolean reverse)
throws IOException
Searcher
search in interface SearcherIOException
public Hits search(Query query,
int numHits,
int maxHitsPerDup)
throws IOException
maxHitsPerDup from the same
site are removed from results. The remaining hits have Hit.moreFromDupExcluded() set. If maxHitsPerDup is zero then all hits are returned.
query - querynumHits - number of requested hitsmaxHitsPerDup - the maximum hits returned with matching values, or zero
IOException
public Hits search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField)
throws IOException
maxHitsPerDup are removed from results. The remaining hits
have Hit.moreFromDupExcluded() set. If maxHitsPerDup is zero then all hits are returned.
query - querynumHits - number of requested hitsmaxHitsPerDup - the maximum hits returned with matching values, or zerodedupField - field name to check for duplicates
IOException
public Hits search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField,
String sortField,
boolean reverse)
throws IOException
maxHitsPerDup are removed from results. The remaining hits
have Hit.moreFromDupExcluded() set. If maxHitsPerDup is zero then all hits are returned.
query - querynumHits - number of requested hitsmaxHitsPerDup - the maximum hits returned with matching values, or zerodedupField - field name to check for duplicatessortField - Field to sort on (or null if no sorting).reverse - True if we are to reverse sort by sortField.
IOException
public String getExplanation(Query query,
Hit hit)
throws IOException
Searcher
getExplanation in interface SearcherIOException
public HitDetails getDetails(Hit hit)
throws IOException
HitDetailer
getDetails in interface HitDetailerIOException
public HitDetails[] getDetails(Hit[] hits)
throws IOException
HitDetailer
getDetails in interface HitDetailerIOException
public Summary getSummary(HitDetails hit,
Query query)
throws IOException
HitSummarizer
getSummary in interface HitSummarizerhit - the details of the hit to be summarizedquery - indicates what should be higlighted in the summary text
IOException
public Summary[] getSummary(HitDetails[] hits,
Query query)
throws IOException
HitSummarizer
getSummary in interface HitSummarizerhits - the details of hits to be summarizedquery - indicates what should be higlighted in the summary text
IOException
public byte[] getContent(HitDetails hit)
throws IOException
HitContent
getContent in interface HitContentIOException
public ParseData getParseData(HitDetails hit)
throws IOException
HitContent
getParseData in interface HitContentIOException
public ParseText getParseText(HitDetails hit)
throws IOException
HitContent
getParseText in interface HitContentIOException
public String[] getAnchors(HitDetails hit)
throws IOException
HitInlinks
getAnchors in interface HitInlinksIOException
public Inlinks getInlinks(HitDetails hit)
throws IOException
HitInlinks
getInlinks in interface HitInlinksIOException
public long getFetchDate(HitDetails hit)
throws IOException
HitContent
getFetchDate in interface HitContentIOException
public void close()
throws IOException
close in interface CloseableIOException
public static void main(String[] args)
throws Exception
Exception
public long getProtocolVersion(String className,
long arg1)
throws IOException
getProtocolVersion in interface org.apache.hadoop.ipc.VersionedProtocolIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||