nutch-default.xml の日本語訳
Nutch の設定は、conf/nutch-default.xml に記述してある値をデフォルトとして使用されます。そして、環境に応じてカスタマイズする場合は、 conf/nutch-site.xml に上書きしたい設定のみを記述していきます。
ここでは、Nutch ver 0.9 のデフォルトの設定である nutch-default.xml の説明の日本語訳と、そのデフォルト値をセクションに分けて掲載します。
file プロトコルの設定
file:// プロトコルを処理する際の動作を設定します。
- file.content.limit: 65536
- file:// プロトコルで、ダウンロードするコンテンツの長さの制限(バイト単位)。 この値が負でない場合、この値より長いコンテンツは切り詰められます。そうでない 場合は切り詰めません。
- file.content.ignored: true
- treu の場合、fetch によってファイルコンテンツは保存されません。 そして、file:// URLはローカルを意味し、パースやインデックス段階では直接ファイルを使うため、おそらくほとんどの場合保存したくないでしょう。false の場合、ファイルコンテンツは保存されます。
- !! まだ実装されてません !!
http プロトコルの設定
http:// プロトコルを処理する際の動作を設定をします。
- http.agent.name:
- HTTP 'User-Agent' request header. MUST NOT be empty - please set this to a single word uniquely related to your organization. NOTE: You should also check other related properties: http.robots.agents http.agent.description http.agent.url http.agent.email http.agent.version and set their values appropriately.
- http.robots.agents: *
- The agent strings we'll look for in robots.txt files, comma-separated, in decreasing order of precedence. You should put the value of http.agent.name as the first agent name, and keep the default * at the end of the list. E.g.: BlurflDev,Blurfl,*
- http.robots.403.allow: true
- /robots.txt が存在しない時に、HTTP ステータス 403 (Forbidden) を返すサーバが あります。 しかしながら、そのサイトをクロールすることを許可されているとみなすべきでしょう。 この値が false の場合、このようなサイトは禁止されたものとして扱います。
- http.agent.description:
- Further description of our bot- this text is used in the User-Agent header. It appears in parenthesis after the agent name.
- http.agent.url:
- A URL to advertise in the User-Agent header. This will appear in parenthesis after the agent name. Custom dictates that this should be a URL of a page explaining the purpose and behavior of this crawler.
- http.agent.email:
- An email address to advertise in the HTTP 'From' request header and User-Agent header. A good practice is to mangle this address (e.g. 'info at example dot com') to avoid spamming.
- http.agent.version: Nutch-0.9
- A version string to advertise in the User-Agent header.
- http.timeout: 10000
- デフォルトのネットワークタイムアウト。ミリセカンドで。
- http.max.delays: 100
- ページ取得を試行するときに、スレッドが延期を行う回数。ホストが混んでいると検出 する度に、fetcher.server.delay だけ待機します。http.max.delays 回の試行後、と りあえずそのページは諦めます。
- http.content.limit: 65536
- ダウンロードするコンテンツの最大長(バイトで)。 負でない値を指定すると、この値より大きいコンテンツは切り詰められ。そうでない 場合は切り詰められません。
- http.proxy.host:
- プロキシホスト名。空の場合、プロキシは使われません。
- http.proxy.port:
- プロキシポート番号。
- http.verbose: false
- true の場合 HTTP はより詳細なログを吐きます。
- http.redirect.max: 0
- ページを取得しようとするときに、fetcher が辿るリダイレクトの最大数。 負の値もしくは 0 を指定すると、リダイレクトURLをすぐには辿らず、代わりに、 後で取得するように記録します。
- http.useHttp11: false
- 注意: 現在これは protocol-httpclient でしか作用しません。 true の場合、HTTP 1.1 を使います。そうでない場合は HTTP 1.0 を使います。
ftp プロトコルの設定
- ftp.username: anonymous
- ftp login username.
- ftp.password: anonymous@example.com
- ftp login password.
- ftp.content.limit: 65536
- The length limit for downloaded content, in bytes. If this value is nonnegative (>=0), content longer than it will be truncated; otherwise, no truncation at all. Caution: classical ftp RFCs never defines partial transfer and, in fact, some ftp servers out there do not handle client side forced close-down very well. Our implementation tries its best to handle such situations smoothly.
- ftp.timeout: 60000
- Default timeout for ftp client socket, in millisec. Please also see ftp.keep.connection below.
- ftp.server.timeout: 100000
- An estimation of ftp server idle time, in millisec. Typically it is 120000 millisec for many ftp servers out there. Better be conservative here. Together with ftp.timeout, it is used to decide if we need to delete (annihilate) current ftp.client instance and force to start another ftp.client instance anew. This is necessary because a fetcher thread may not be able to obtain next request from queue in time (due to idleness) before our ftp client times out or remote server disconnects. Used only when ftp.keep.connection is true (please see below).
- ftp.keep.connection: false
- Whether to keep ftp connection. Useful if crawling same host again and again. When set to true, it avoids connection, login and dir list parser setup for subsequent urls. If it is set to true, however, you must make sure (roughly): (1) ftp.timeout is less than ftp.server.timeout (2) ftp.timeout is larger than (fetcher.threads.fetch * fetcher.server.delay) Otherwise there will be too many "delete client because idled too long" messages in thread logs.
- ftp.follow.talk: false
- Whether to log dialogue between our client and remote server. Useful for debugging.
データベースの設定
CrawlDB や LinkDB の動作を設定します。
- db.default.fetch.interval: 30
- ページを再取得するまでの日数の規定値。
- db.update.additions.allowed: true
- true の場合、updatedb は新たに発見したURLを追加する。false の場合、 CrawlDb に存在する URL のみ更新され、新たなURLは追加されない。
- db.ignore.internal.links: true
- true の場合、ページに新しいリンクを追加する時、同じホストからのものは無視する。 これは、リンクデータベースのサイズを制限し、最も品質の高いリンクのみに保つのに 効果的な方法です。
- db.ignore.external.links: false
- true の場合、ページから外部ホストへのリンクは無視されます。これは、 複雑な URLFilter を作らずに、初期設定されたホストのみをクロールする場合に効果 的です。
- db.score.injected: 1.0
- インジェクタによって、新規ページに付与されるスコアの値。
- db.score.link.external: 1.0
- 他のホストからのリンクによって追加されたページのスコア係数。参照しているページ のスコアに掛け合わされます。スコアリングプラグインが外部リンクの初期のスコアを 与えるために使われます。
- db.score.link.internal: 1.0
- 同一ホストからのリンクによって追加されたページのスコア係数。参照しているページ のスコアに掛け合わされます。スコアリングプラグインが内部リンクの初期のスコアを 与えるために使われます。
- db.score.count.filtered: false
- 新しく発見されたページに渡されるスコアの値は、元のページのスコアを outlink の 数で割った値として計算されます。このオプションが false の場合、URLFilter に マッチした outlink のみが使われます。 true の場合、すべての outlink が使われま す。
- db.max.inlinks: 10000
- LinkDb に保存される、URL あたりの inlink の数の最大値。 もし "invertlinks" がこの値より多くの inlink を見つけた場合、最初の N 個の inlink のみ保存され、残りは破棄される。
- db.max.outlinks.per.page: 100
- ページあたりの処理する outlink の最大数。 この値が負でない(>=0)場合、1つのページあたり、最大で db.max.outlinks.per.page 個の outlink が処理される。それ以外の場合、すべての outlink が処理される。
- db.max.anchor.length: 100
- アンカーの文字列の長さの最大値。
- db.fetch.retry.max: 3
- 取得時に発生する回復可能なエラーに遭遇した URL の回数の最大値。
- db.signature.class: org.apache.nutch.crawl.MD5Signature
- ページシグネチャのデフォルトの実装。この実装で作られたシグネチャは、重複検出と 除去のために使われます。
- db.signature.text_profile.min_token_len: 2
- Minimum token length to be included in the signature.
- db.signature.text_profile.quant_rate: 0.01
- Profile frequencies will be rounded down to a multiple of QUANT = (int)(QUANT_RATE * maxFreq), where maxFreq is a maximum token frequency. If maxFreq > 1 then QUANT will be at least 2, which means that for longer texts tokens with frequency 1 will always be discarded.
generate の設定
CrawlDB から fetchlist を生成する際のコマンド generate の設定をします。
- generate.max.per.host: -1
- 1つの fetchlist に含まれる、ホストあたりのURLの最大数。 -1 の場合無制限。
- generate.max.per.host.by.ip: false
- false の場合、同じホスト名が数えられる。 true の場合、ホストのIPアドレスを解決し、同じIPが数えられる。
- -+-+-+- 警告!!! -+-+-+-
true に指定した場合、Generator は大量の DNS リクエストが高速に発行されます。 これは、外部へのトラフィックと遅延を増大させることは言うまでもなく、リモートの DNSサーバへの DOS 攻撃を引き起こします。これらの理由により、このオプションを使 うには、ローカルのキャッシュDNSを使うことが必要です。 - generate.update.crawldb: false
- いくつもの generate/fetch/update サイクルが重なるような高度に並列化された環 境向けの設定。この設定を true にすると generate は、updatedb 行わなくても異 なる fetchlist を作成する。これは CrawlDB を更新する追加のジョブのコストが発生 する。 false の場合、updatedb を間に行わずに2回連続で generate を実行すると、まったく 同じ fetchlist を生成する。
fetcher の設定
巡回の機能を設定します。
- fetcher.server.delay: 5.0
- リクエストが成功した場合に、同じサーバに対してリクエストを行う間隔(秒数)。
- fetcher.max.crawl.delay: 30
- もし、robots.txt の Crawl-Delay の値が、この値(秒)よりも大きい場合、fetcher は このページをスキップし、エラーレポートを生成する。 この値を -1 にした場合、fetcher はこのようなページをスキップせず、robots.txt の Crawl-Delay で指示された時間だけ(どんなに長かろうと)待機します。
- fetcher.threads.fetch: 10
- fetcher が使用する FetcherThreads のスレッド数。 これは一度に実行されるリクエストの最大数からも決定される(それぞれの FetcherThread は1つのコネクションを処理する)。
- fetcher.threads.per.host: 1
- 1つのホストに同時にアクセスできるスレッドの最大数。
- fetcher.threads.per.host.by.ip: true
- true の場合、fetcher は、URLのホスト名を解決して得られたIPアドレスによってスレ ッドの数を数える。 falseの場合、ホスト名のみ使われる。注意: これは "generate.max.per.host.by.ip" と同じ値が使われるべきで、デフォルト値は後方互換のためだけに違う値が使われてい る。
- fetcher.verbose: false
- true の場合、fetcher はより詳細にログを吐きます。
- fetcher.parse: true
- true の場合、fetcher はコンテンツをパースします。
- fetcher.store.content: true
- true の場合、 fetcher はコンテンツを保存します。
indexer の設定
検索インデックスを生成する際の設定です。
- indexer.score.power: 0.5
- リンク解析スコア指数を決定します。 それぞれのページの boost は、score^scorePower に設定され、score はペー ジのリンク解析スコアで、scorePower はこのパラメータの値です。これはイン デックスに蓄積されるので、この値が変わった時はページを再インデックスしなくては なりません。
- indexer.max.title.length: 100
- インデックスされるタイトルの最大長。
- indexer.max.tokens: 10000
- ドキュメントの1つのフィールドにインデックスされるトークンの最大数。 これはインデックス処理に必要なメモリの量を制限するので、大量のファイルをインデ ックスする際に、Out of Memory でインデックス処理が落ちることがないでしょう。 これは大きなドキュメントに現れる特徴的なインデックストークン以外を除去して効率 的に切り詰めるということに注意してください。ソースドキュメントが巨大なことがわ かっている場合、予期したサイズに対応するのに十分大きな値に設定することを確認し てください。この値を Integer.MAX_VALUE に指定した場合、唯一の制限は搭載してい るメモリになりますが、OutOfMemoryError が予想されます。
- indexer.mergeFactor: 50
- Lucene のセグメントマージの頻度を決定する係数です。 2未満を指定しないでください。この値を大きくすると、インデックス速度が上がりま すが、メモリ使用量も増え、 開くファイルハンドルも増えます(これは "Too many open files" エラーを引き起こすかもしれません)。 注意: "セグメント" は、Nutch セグメントとは関係ありません。これは Lucene で使 用される低レベルのデータ単位です。
- indexer.minMergeDocs: 50
- This number determines the minimum number of Lucene Documents buffered in memory between Lucene segment merges. Larger values increase indexing speed and increase RAM usage.
- indexer.maxMergeDocs: 2147483647
- This number determines the maximum number of Lucene Documents to be merged into a new Lucene segment. Larger values increase batch indexing speed and reduce the number of Lucene segments, which reduces the number of open file handles; however, this also decreases incremental indexing performance.
- indexer.termIndexInterval: 128
- 検索時にランダムアクセスを促進するために、Lucene がメモリに保持する term の割 合を決定します。この値を小さくすると、たくさんのメモリを使用しますが、いくらか 検索が早くなります。この値を大きくすると、メモリ使用量は減りますが、いくらか検 索が遅くなります。
- indexingfilter.order:
- インデックスフィルタが適用される順番を指定します。 空にした場合、すべての有効なインデックスフィルタ(plugin-includes と lugin-excludes プロパティで指示されたように)がロードされ、システムで定義された 順番に適用されます。空でない場合、名前のあるフィルタのみがロードされ、指定され た順番で適用されます。たとえば、このプロパティが: org.apache.nutch.indexer.basic.BasicIndexingFilter org.apache.nutch.indexer.more.MoreIndexingFilter という値を持つ場合、BasicIndexingFilter が最初に適用され、次に MoreIndexingFilter が適用されます。 あるフィルタが他のフィルタの出力に依存している場合、フィルタの順番は結果に影響 を及ぼします。
analysis の設定
インデックスを作る際に、文章を解析するための設定です。
- analysis.common.terms.file: common-terms.utf8
- n-grams を用いてインデックスされるべき common terms のリストを記述したファイルの名前。
searcher の設定
インデックスを検索する機能の設定です。
- searcher.dir: crawl
- crawl のルートのパス。このディレクトリは、分散検索サーバの一覧を記述したファイル search-server.txt を探すためや、複数のインデックスをマージした "index" ディレクトリや、セグメントインデックスを含む "segments" ディレクトリを探すために使われます。
- searcher.filter.cache.size: 16
- Maximum number of filters to cache. Filters can accelerate certain field-based queries, like language, document format, etc. Each filter requires one bit of RAM per page. So, with a 10 million page index, a cache size of 16 consumes two bytes per page, or 20MB.
- searcher.filter.cache.threshold: 0.05
- Filters are cached when their term is matched by more than this fraction of pages. For example, with a threshold of 0.05, and 10 million pages, the term must match more than 1/20, or 50,000 pages. So, if out of 10 million pages, 50% of pages are in English, and 2% are in Finnish, then, with a threshold of 0.05, searches for "lang:en" will use a cached filter, while searches for "lang:fi" will score all 20,000 finnish documents.
- searcher.hostgrouping.rawhits.factor: 2.0
- A factor that is used to determine the number of raw hits initially fetched, before host grouping is done.
- searcher.summary.context: 5
- The number of context terms to display preceding and following matching terms in a hit summary.
- searcher.summary.length: 20
- The total number of terms to display in a hit summary.
- searcher.max.hits: -1
- If positive, search stops after this many hits are found. Setting this to small, positive values (e.g., 1000) can make searches much faster. With a sorted index, the quality of the hits suffers little.
- searcher.max.time.tick_count: -1
- If positive value is defined here, limit search time for every request to this number of elapsed ticks (see the tick_length property below). The total maximum time for any search request will be then limited to tick_count * tick_length milliseconds. When search time is exceeded, partial results will be returned, and the total number of hits will be estimated.
- searcher.max.time.tick_length: 200
- The number of milliseconds between ticks. Larger values reduce the timer granularity (precision). Smaller values bring more overhead.
URL ノーマライザの設定
- urlnormalizer.order: org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer org.apache.nutch.net.urlnormalizer.regex.RegexURLNormalizer
- URLノーマライザが実行される順番。 Order in which normalizers will run. If any of these isn't activated it will be silently skipped. If other normalizers not on the list are activated, they will run in random order after the ones specified here are run.
- urlnormalizer.regex.file: regex-normalize.xml
- Name of the config file used by the RegexUrlNormalizer class.
- urlnormalizer.loop.count: 1
- Optionally loop through normalizers several times, to make sure that all transformations have been performed.
mime の設定
- mime.types.file: mime-types.xml
- Name of file in CLASSPATH containing filename extension and magic sequence to mime types mapping information
- mime.type.magic: true
- Defines if the mime content type detector uses magic resolution.
プラグインの設定
- plugin.folders: plugins
- プラグインが置いてあるディレクトリ。各要素は相対パスでも絶対パスでもかまいません。絶対パスの場合そのまま使われますが、相対パスの場合クラスパス上でそのパスが探されます。
- plugin.auto-activation: true
- plugin.includes と plugin.excludes プロパティに関連してアクティブになっていないプラグインが、他のアクティブなプラグインによって必要とされている場合、自動的にアクティブになるかどうかを定義します。
- plugin.includes: protocol-http|urlfilter-regex|parse-(text|html|js)|index-basic|query-(basic|site|url)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)
- インクルードするプラグインのディレクトリ名を指定する正規表現です。この式にマッチしないプラグインは除外されます。どんな場合でも、少なくとも nutch-extensionpoints プラグインはインクルードする必要があります。デフォルトでは Nutch は、HTTP 経由でテキストとHTMLのみをクロール、基本的なインデクシングと検索プラグインをインクルードしています。HTTPS を使うには、protocol-http クライアントをインクルードしてください。しかし、commons-http クライアントライブラリに内在する間欠的な問題の可能性があることに注意してください。
- plugin.excludes:
- 除外するプラグインのディレクトリ名を指定する正規表現。
パーサの設定
- parse.plugin.file: parse-plugins.xml
- content-type とパーサとの関連を定義したファイルの名前。
- parser.character.encoding.default: windows-1252
- 他に情報がない場合に使われる文字エンコーディング。
- parser.caching.forbidden.policy: content
- サイト(もしくはページ)が、その robot メタタグを通じて、キャッシュされたコンテ ンツとして表示すべきでないと要求した場合、 このポリシーが適用されます。現在 3つのキーワードが認識されます: "none" はいか なる "noarchive" ディレクティブを無視します。 "content" はコンテンツを表示しませんが、サマリ(断片)は表示します。"all" は、コ ンテンツもサマリも表示しません。
- parser.html.impl: neko
- HTML パーサー実装。現在、以下のキーワードを認識します: "neko" は NekoHTML を、 "tagsoup" は TagSoup を使用します。
- parser.html.form.use_action: false
- true の場合、HTMLパーサーは from の action 属性からも URL を集めます。 これは望ましくない挙動(次回の取得サイクルでの空の form 投稿)を導くかもしれませ ん。false の場合、form の action 属性は無視されます。
URLフィルタプラグインの設定
- urlfilter.regex.file: regex-urlfilter.txt
- Name of file on CLASSPATH containing regular expressions used by urlfilter-regex (RegexURLFilter) plugin.
- urlfilter.automaton.file: automaton-urlfilter.txt
- Name of file on CLASSPATH containing regular expressions used by urlfilter-automaton (AutomatonURLFilter) plugin.
- urlfilter.prefix.file: prefix-urlfilter.txt
- Name of file on CLASSPATH containing url prefixes used by urlfilter-prefix (PrefixURLFilter) plugin.
- urlfilter.suffix.file: suffix-urlfilter.txt
- Name of file on CLASSPATH containing url suffixes used by urlfilter-suffix (SuffixURLFilter) plugin.
- urlfilter.order:
- The order by which url filters are applied. If empty, all available url filters (as dictated by properties plugin-includes and plugin-excludes above) are loaded and applied in system defined order. If not empty, only named filters are loaded and applied in given order. For example, if this property has value: org.apache.nutch.urlfilter.regex.RegexURLFilter org.apache.nutch.urlfilter.prefix.PrefixURLFilter then RegexURLFilter is applied first, and PrefixURLFilter second. Since all filters are AND'ed, filter ordering does not have impact on end result, but it may have performance implication, depending on relative expensiveness of filters.
スコアリングフィルタの設定
- scoring.filter.order:
- The order in which scoring filters are applied. This may be left empty (in which case all available scoring filters will be applied in the order defined in plugin-includes and plugin-excludes), or a space separated list of implementation classes.
クラスタリング・エクステンションの設定
- extension.clustering.hits-to-cluster: 100
- Number of snippets retrieved for the clustering extension if clustering extension is available and user requested results to be clustered.
- extension.clustering.extension-name:
- Use the specified online clustering extension. If empty, the first available extension will be used. The "name" here refers to an 'id' attribute of the 'implementation' element in the plugin descriptor XML file.
オントロジー・エクステンションの設定
- extension.ontology.extension-name:
- Use the specified online ontology extension. If empty, the first available extension will be used. The "name" here refers to an 'id' attribute of the 'implementation' element in the plugin descriptor XML file.
- extension.ontology.urls:
- Urls of owl files, separated by spaces, such as http://www.example.com/ontology/time.owl http://www.example.com/ontology/space.owl http://www.example.com/ontology/wine.owl Or file:/ontology/time.owl file:/ontology/space.owl file:/ontology/wine.owl You have to make sure each url is valid. By default, there is no owl file, so query refinement based on ontology is silently ignored.
query-basic プラグインの設定
- query.url.boost: 4.0
- Used as a boost for url field in Lucene query.
- query.anchor.boost: 2.0
- Used as a boost for anchor field in Lucene query.
- query.title.boost: 1.5
- Used as a boost for title field in Lucene query.
- query.host.boost: 2.0
- Used as a boost for host field in Lucene query.
- query.phrase.boost: 1.0
- Used as a boost for phrase in Lucene query. Multiplied by boost for field phrase is matched in.
creative-commons プラグインの設定
- query.cc.boost: 0.0
- Used as a boost for cc field in Lucene query.
query-more プラグインの設定
- query.type.boost: 0.0
- Used as a boost for type field in Lucene query.
query-site プラグインの設定
- query.site.boost: 0.0
- Used as a boost for site field in Lucene query.
microformats-reltag プラグインの設定
- query.tag.boost: 1.0
- Used as a boost for tag field in Lucene query.
language-identifier プラグインの設定
- lang.ngram.min.length: 1
- The minimum size of ngrams to uses to identify language (must be between 1 and lang.ngram.max.length). The larger is the range between lang.ngram.min.length and lang.ngram.max.length, the better is the identification, but the slowest it is.
- lang.ngram.max.length: 4
- The maximum size of ngrams to uses to identify language (must be between lang.ngram.min.length and 4). The larger is the range between lang.ngram.min.length and lang.ngram.max.length, the better is the identification, but the slowest it is.
- lang.analyze.max.length: 2048
- The maximum bytes of data to uses to indentify the language (0 means full content analysis). The larger is this value, the better is the analysis, but the slowest it is.
- query.lang.boost: 0.0
- Used as a boost for lang field in Lucene query.




