websphinx.searchengine
Class MetaCrawler
java.lang.Object
|
+--websphinx.searchengine.MetaCrawler
- All Implemented Interfaces:
- Classifier, SearchEngine, java.io.Serializable
- public class MetaCrawler
- extends java.lang.Object
- implements SearchEngine
MetaCrawler search engine.
- See Also:
- Serialized Form
Method Summary |
void |
classify(Page page)
Classify a page. |
float |
getPriority()
Get priority of this classifier. |
int |
getResultsPerPage()
Get number of results per page for this search engine. |
java.net.URL |
makeQuery(java.lang.String keywords)
Make a query URL for MetaCrawler. |
static Search |
search(java.lang.String keywords)
Search MetaCrawler. |
static Search |
search(java.lang.String keywords,
int maxResults)
Search MetaCrawler. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
patCount
static Pattern patCount
patNoHits
static Pattern patNoHits
patResult
static Pattern patResult
patMoreLink
static Pattern patMoreLink
priority
public static final float priority
- Priority of this classifier.
MetaCrawler
public MetaCrawler()
classify
public void classify(Page page)
- Classify a page. Sets the following labels:
Name | Type | Meaning
|
---|
searchengine.source | Page label | MetaCrawler object that labeled the page
|
searchengine.count | Page field | Number of results on page
|
searchengine.results | Page fields | Array of results. Each result region
contains subfields: rank, title, description, and link.
|
searchengine.more-results | Link label | Link to a page containing more results.
|
- Specified by:
classify
in interface Classifier
- Following copied from interface:
websphinx.Classifier
- Parameters:
page
- Page to classify
getPriority
public float getPriority()
- Get priority of this classifier.
- Specified by:
getPriority
in interface Classifier
- Returns:
- priority.
makeQuery
public java.net.URL makeQuery(java.lang.String keywords)
- Make a query URL for MetaCrawler.
- Specified by:
makeQuery
in interface SearchEngine
- Parameters:
keywords
- list of keywords, separated by spaces- Returns:
- URL that submits the keywords to MetaCrawler.
getResultsPerPage
public int getResultsPerPage()
- Get number of results per page for this search engine.
- Specified by:
getResultsPerPage
in interface SearchEngine
- Returns:
- typical number of results per page
search
public static Search search(java.lang.String keywords)
- Search MetaCrawler.
- Parameters:
keywords
- list of keywords, separated by spaces- Returns:
- enumeration of SearchEngineResults returned by an MetaCrawler query constructed from the keywords.
search
public static Search search(java.lang.String keywords,
int maxResults)
- Search MetaCrawler.
- Parameters:
keywords
- list of keywords, separated by spacesmaxResults
- maximum number of results to return- Returns:
- enumeration of SearchEngineResults returned by an MetaCrawler query constructed from the keywords.
The enumeration yields at most maxResults objects.