0

如何使用Solr对nutch爬取的文档进行语言识别?

我安装了Nutch 1.9Solr 4.8.1"core-test" 我在 Solr Admin 页面中添加了一个新核心,通过 Core Admin命名为 solr,并按照Solr wiki中的步骤在文档索引期间进行语言检测。

我通过添加字段修改了 core-test/conf 中的schema.xml

<field name="language_s" type="string" stored="true" indexed="true"/>

然后,我使用 Nutch 爬取了一组网页

crawl seed.txt Test http://localhost:8983/solr/core-test 2

Nutch 工作正常,但未识别文档的语言,即language_s当我在http://localhost:8983/solr/#/core-test/query中进行查询并将q设置为时,我没有获得该字段":"

4

1 回答 1

2

您需要启用 Nutch 的语言检测。将下面的 xml 标签复制到Nutch_HOME/conf/nutch-site.xml

<property> <name>plugin.includes</name> <value>protocol-http|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|indexer-solr|scoring-opic|urlnormalizer-(pass|regex|basic)|language-identifier</value> </property>

上面的标签启用了与 Nutch 捆绑的语言检测插件。如Nutch 的 wiki中所述,该插件将添加一个名为“lang”的字段,其中包含文档的语言代码。

于 2015-05-19T20:35:11.297 回答