【问题标题】:Language Detection in Solr for Nutch documentsSolr 中用于 Nutch 文档的语言检测
【发布时间】:2015-05-19 09:27:30
【问题描述】:

如何使用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 工作正常,但未识别文档的语言,即当我在 http://localhost:8983/solr/#/core-test/query 中将 q 设置为 ":" 进行查询时,我没有获得字段 language_s

【问题讨论】:

    标签: apache solr nutch language-detection


    【解决方案1】:

    您需要启用 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's wiki 中所述,该插件将添加一个名为“lang”的字段,其中包含您文档的语言代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-22
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2011-12-26
      相关资源
      最近更新 更多