Differences between revisions 2 and 3
Revision 2 as of 2013-03-20 21:27:20
Size: 1205
Comment:
Revision 3 as of 2014-06-18 11:13:10
Size: 1800
Editor: JulienNioche
Comment:
Deletions are marked like this. Additions are marked like this.
Line 26: Line 26:
The injector uses the following configurations (see https://issues.apache.org/jira/browse/NUTCH-1405)

* db.injector.overwrite = [true|false] : replace the entries in the crawldb with the corresponding ones from the seed data. Will set the status to UNFETCHED.

* db.injector.update = [true|false] : Keeps the existing entries in the crawldb but replaces the score and fetch interval with the values found for the corresponding entries in the seed data. Any metadata found for the seed entry are added. The status remains what it was in the original version of the crawldb, e.g. FETCHED.

Inject is an alias for org.apache.nutch.crawl.Injector

This class takes a flat file of URLs and adds them to the of pages to be crawled. It is useful for bootstrapping the system. The URL files contain one URL per line, optionally followed by custom metadata separated by tabs with the metadata key separated from the corresponding value by '='.

Note that some metadata keys are reserved:

nutch.score: allows to set a custom score for a specific URL

nutch.fetchInterval: allows to set a custom fetch interval for a specific URL

userType: this can be any metadata field which you then assign a value. In the example here we use userType to refer to the nature of Nutch as an open source project.

e.g. http://www.xyz.org/ nutch.score=10 nutch.fetchInterval=2592000 userType=open_source

Nutch 1.x

Usage:

bin/nutch inject <crawldb> <url_dir>

<crawldb>: The directory containing the crawldb

<url_dir>: The directory containing our seed list (referred to above as 'flat file'), usually a text document containing URLs, one URL per line.

The injector uses the following configurations (see https://issues.apache.org/jira/browse/NUTCH-1405)

* db.injector.overwrite = [true|false] : replace the entries in the crawldb with the corresponding ones from the seed data. Will set the status to UNFETCHED.

* db.injector.update = [true|false] : Keeps the existing entries in the crawldb but replaces the score and fetch interval with the values found for the corresponding entries in the seed data. Any metadata found for the seed entry are added. The status remains what it was in the original version of the crawldb, e.g. FETCHED.

Nutch 2.x

Usage: InjectorJob <url_dir> [-crawlId <id>]

CommandLineOptions

bin/nutch inject (last edited 2014-06-18 11:13:10 by JulienNioche)