|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.searcher.NutchBean
One stop shopping for search-related functionality.
Field Summary | |
static Logger |
LOG
|
Constructor Summary | |
NutchBean()
Construct reading from connected directory. |
|
NutchBean(File dir)
Construct in a named directory. |
Method Summary | |
static NutchBean |
get(javax.servlet.ServletContext app)
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 anchors 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. |
String[] |
getSegmentNames()
The name of the segments searched by this node. |
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)
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 Logger LOG
Constructor Detail |
public NutchBean() throws IOException
public NutchBean(File dir) throws IOException
Method Detail |
public static NutchBean get(javax.servlet.ServletContext app) 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 String 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 String[] 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
HitContent
getAnchors
in interface HitContent
IOException
public long getFetchDate(HitDetails hit) throws IOException
HitContent
getFetchDate
in interface HitContent
IOException
public static void main(String[] args) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |