nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Nutch Wiki] Trivial Update of "NutchScoring" by LewisJohnMcgibbney
Date Sun, 21 Sep 2014 19:52:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Nutch Wiki" for change notification.

The "NutchScoring" page has been changed by LewisJohnMcgibbney:

  A scoring filter will manipulate scoring variables in CrawlDatum and in resulting search
indexes. Filters can be chained in a specific order, to provide multi-stage scoring adjustments.
  == Where Scoring takes place within the Nutch Crawl cycle ==
- Scoring occurs in numerous places throughout the Nutch codebase and consequently within
the crawl cycle. This section describes the point of occurence and functional purpose at each
+ Scoring occurs in numerous places throughout the Nutch codebase and consequently within
the crawl cycle. This section describes the point of occurence and functional purpose Scoring
serves at each step. You will see that the list of elements has been structured to represent
the logical and typical progression of a Nutch crawl cycle.
   * [[|./src/java/org/apache/nutch/crawl/]]
- Scoring filters are defined within the various MapReduce job configurations. This means
that the desired configuration will be used appropriately at runtime when the job is run by
the JobClient. The Injector actually contains two MapReduce jobs, namely
      * sortJob - where we set the InjectMapper as the Mapreduce Mapper override. The InjectMapper
uses ScoringFilters to calculate a new initial score for a particular URL based on passing
in the Hadoop Text key (representing the URL of the page) and associated CrawlDatum value
(representing a new datum for which filters will modify it in-place) to the ScoringFilters.injectedScore
method. Essentially this sets an initial score for newly injected pages. It should be noted
that newly injected pages may have no inlinks, so filter implementations may wish to set this
score to a non-zero value, to give newly injected pages some initial credit. We are concerned
with the value for {{{db.score.injected}}} in this case as this assigns a default of 1.0f
against the score of new pages added by the injector. This default score can however be overridden
by associating the {{{nutch.score}}} metadata flag against any URL in a seed list. This allows
to set a custom score for a specific URL. If this is the case we assign this score to the
CrawlDatum object, if not then we use the default score as described above.
      * mergeJob - which combines multiple new entries for a given URL. An example of when
this is necessary would be if we attempt to inject two indentical URLs within the same seed
list and where these should be merged into one record. In this job we are concerned with discovering
the value for the {{{db.score.injected}}} configuration property present within {{{nutch-site.xml}}}
as populated in the initial sortJob execution as described above. This value represents the
score of new pages added by the Injector. This is relevant for us as we must know if a record
already exists and we wish to update but not overwrite the value.
   * [[|./src/java/org/apache/nutch/crawl/]]
- ScoringFilters are used within the [[|Generator.Selector]]
class. This essentially selects URL entires due for Fetching and is the only functionality
of the Genertor we need to cover within the context of this document. In addition to specifying
the ScoringFilters within the MapReduce job configuration, we also use ScoringFilter functionality
within the Map aspect of this job which selects and inverts a subset of URLs due for fetching.
In particular we implement the {{{Generator.Selector.generatorSortValue}}} method which prepares
a sort value for the purpose of sorting and selecting top N scoring pages during fetchlist
generation. We pass in arguments for Hadoop Text key {{{url}}} (representing the url of the
page we are trying to score), Nutch CrawlDatum value {{{datum}}} which represents the page's
datum which should not be modified in this task) and an initial sort value {{{initSort}}}
of 1.0f. It should be noted that the final value doesn't always need to be set to 1.0f as
it can be linked to a value from previous filters in chain of Scoring implementations. The
result of executing the {{{Generator.Selector.generatorSortValue}}} function is subsequently
used to consider only entries with a score superior to the threshold which should then be
+  * [[|./src/java/org/apache/nutch/fetcher/]]
   * ./src/java/org/apache/nutch/crawl/
-  * ./src/java/org/apache/nutch/fetcher/
   * ./src/java/org/apache/nutch/fetcher/
   * ./src/java/org/apache/nutch/indexer/
   * ./src/java/org/apache/nutch/parse/

View raw message