|
||||||||||
| 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(Configuration conf)
|
|
NutchBean(Configuration conf,
Path dir)
Construct in a named directory. |
|
| Method Summary | |
|---|---|
void |
close()
|
static NutchBean |
get(javax.servlet.ServletContext app,
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 clientVersion)
|
String[] |
getSegmentNames()
|
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. |
boolean |
ping()
|
static List<InetSocketAddress> |
readAddresses(Path path,
Configuration conf)
|
static List<String> |
readConfig(Path path,
Configuration conf)
|
Hits |
search(Query query)
Return the top-scoring hits for a query. |
Hits |
search(Query query,
int numHits)
Deprecated. since 1.1, use search(Query) instead |
Hits |
search(Query query,
int numHits,
int maxHitsPerDup)
Deprecated. since 1.1, use search(Query) instead |
Hits |
search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField)
Deprecated. since 1.1, use search(Query) instead |
Hits |
search(Query query,
int numHits,
int maxHitsPerDup,
String dedupField,
String sortField,
boolean reverse)
Deprecated. since 1.1, use search(Query) instead |
Hits |
search(Query query,
int numHits,
String dedupField,
String sortField,
boolean reverse)
Deprecated. since 1.1, use search(Query) instead |
| 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(Configuration conf)
throws IOException
conf -
IOException
public NutchBean(Configuration conf,
Path dir)
throws IOException
conf - dir -
IOException| Method Detail |
|---|
public static NutchBean get(javax.servlet.ServletContext app,
Configuration conf)
throws IOException
IOExceptionNutchBean.NutchBeanConstructor
public static List<InetSocketAddress> readAddresses(Path path,
Configuration conf)
throws IOException
IOException
public static List<String> readConfig(Path path,
Configuration conf)
throws IOException
IOException
public String[] getSegmentNames()
throws IOException
getSegmentNames in interface SegmentBeanIOException
public Hits search(Query query,
int numHits)
throws IOException
search(Query) instead
IOException
public Hits search(Query query,
int numHits,
String dedupField,
String sortField,
boolean reverse)
throws IOException
search(Query) instead
Searcher
search in interface SearcherIOException
public Hits search(Query query)
throws IOException
Searcher
search in interface SearcherIOException
public Hits search(Query query,
int numHits,
int maxHitsPerDup)
throws IOException
search(Query) instead
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
search(Query) instead
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
search(Query) instead
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 CloseableIOExceptionpublic boolean ping()
ping in interface SearchBean
public static void main(String[] args)
throws Exception
Exception
public long getProtocolVersion(String className,
long clientVersion)
throws IOException
getProtocolVersion in interface VersionedProtocolIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||