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. nutch.score=10 nutch.fetchInterval=2592000 userType=open_source

Nutch 1.x


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

* 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>]


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