|
||||||||||
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.
Field Summary | |
---|---|
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)
Cache in 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
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
IOException
public 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 Searcher
IOException
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 Searcher
IOException
public HitDetails getDetails(Hit hit) throws IOException
HitDetailer
getDetails
in interface HitDetailer
IOException
public HitDetails[] getDetails(Hit[] hits) throws IOException
HitDetailer
getDetails
in interface HitDetailer
IOException
public Summary getSummary(HitDetails hit, Query query) throws IOException
HitSummarizer
getSummary
in interface HitSummarizer
hit
- 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 HitSummarizer
hits
- 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 HitContent
IOException
public ParseData getParseData(HitDetails hit) throws IOException
HitContent
getParseData
in interface HitContent
IOException
public ParseText getParseText(HitDetails hit) throws IOException
HitContent
getParseText
in interface HitContent
IOException
public String[] getAnchors(HitDetails hit) throws IOException
HitInlinks
getAnchors
in interface HitInlinks
IOException
public Inlinks getInlinks(HitDetails hit) throws IOException
HitInlinks
getInlinks
in interface HitInlinks
IOException
public long getFetchDate(HitDetails hit) throws IOException
HitContent
getFetchDate
in interface HitContent
IOException
public void close() throws IOException
close
in interface Closeable
IOException
public static void main(String[] args) throws Exception
Exception
public long getProtocolVersion(String className, long arg1) throws IOException
getProtocolVersion
in interface VersionedProtocol
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |