You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nutch 1.19 对接 Solr 9.4.0:如何配置指向Solr实例?

Nutch 1.15+ 对接Solr核心(核心名nutch)配置步骤

1. 生成正式的索引配置文件

先从模板文件复制出可编辑的配置文件:

cp conf/index-writers.xml.template conf/index-writers.xml

2. 编辑index-writers.xml启用Solr写入器

打开conf/index-writers.xml,找到Solr相关配置块,按以下方式修改:

  • 移除包裹Solr writer配置的<!-- -->注释标签,启用该写入器
  • 修改solr.server.url参数值为你的Solr核心地址,本地默认环境下应为:
    <param name="solr.server.url" value="http://localhost:8983/solr/nutch"/>
    
  • 其他参数(如commitSize、auth等)保持默认即可;若Solr开启了认证,需额外配置用户名密码参数

3. 确认Nutch插件配置

检查conf/nutch-site.xml中的plugin.includes配置项,确保包含solrindexwriter插件,示例配置片段:

<property>
  <name>plugin.includes</name>
  <value>protocol-httpclient|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|query-(basic|site|url)|response-(json|xml)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)|solrindexwriter</value>
</property>

4. 执行索引到Solr的命令

爬取完成后,运行以下命令将爬取数据索引到Solr核心:

bin/nutch solrindex http://localhost:8983/solr/nutch crawl/crawldb crawl/linkdb crawl/segments/*

常见排查点

  • 确认Solr服务处于运行状态,可通过浏览器访问http://localhost:8983/solr验证
  • 确认Solr核心nutch已正确创建,可在Solr管理界面的核心列表中查看
  • 检查Nutch日志(logs/目录下),若索引命令执行失败,日志会给出具体错误信息

内容的提问来源于stack exchange,提问作者Weiqi Hu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 12:05:01