Nutch1.9安装
来源:互联网 发布:斑马梦龙网络计划2016 编辑:程序博客网 时间:2024/05/16 16:17
一、 Nutch安装并整合到Solr
1、下载并解压Nutch(此处使用版本1.9) http://nutch.apache.org/
2、修改apache-nutch-1.9/conf/nutch-site.xml
<property>
<name>http.agent.name</name>
<value>My Nutch Spider</value>
</property>
3、添加需要爬取的urls种子,创建apache-nutch-1.9/urls/seed.txt:
此处添加一条url(如:http://www.oschina.net/)
4、Nutch与Solr整合需要替换Solr Home中的Schema.xml
首先做好备份:
mv solr_home/solr/collection1/conf/schema.xml solr_home/solr/collection1/conf/schema.xml.org
将nutch中的schema-solr4.xml copy到solr_home中,如下:
cp apache-nutch-1.9/conf/schema-solr4.xml solr_home/solr/collection1/conf/schema.xml
5、修改solr_home/solr/collection1/conf/schema.xml,
在 <field name="id"下面加上
<field name="_version_" type="long" indexed="true" stored="true"/>
由于覆盖了之前配置好的IK分词器。所以需要重新配置:
在<types>中增加如下内容:
<fieldType name="text_ik" class="solr.TextField">
<analyzer type="index" isMaxWordLength="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/>
<analyzer type="query" isMaxWordLength="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
将需要用到IK分词的字段的type值修改以上定义的name
<field name="content" type="text_ik" stored="true" indexed="true"/>
<field name="title" type="text_ik" stored="true" indexed="true"/>
<field name="text" type="text_ik" stored="false" indexed="true" multiValued="true"/>
<field name="anchor" type="text_ik" stored="true" indexed="true"/>
到此处配置完成。
测试爬取:
bin/crawl urls/ crawldb/ http://localhost:8080/solr/ 1
当完成后,打开solr的管理界面,点击query将会看到nutch爬取的数据- Linux安装nutch1.9
- nutch1.9安装
- Nutch1.9安装
- nutch1.9--nutch安装记录
- Nutch1.9安装配置与基本使用介绍
- Nutch1.9安装配置与基本使用介绍
- Nutch1.4安装及测试
- Nutch1.2的安装使用。
- nutch1.9_mysql
- Nutch1
- nutch1.9 如何设置 topN
- Windows下开源搜索引擎Nutch1.2的安装
- Nutch1.2 的安装与使用
- Centos7下安装配置nutch1.4
- nutch1.6安装使用中错误解决方法
- CentOS6.5下nutch1.7+solr4.8.1+Eclipse环境搭建(一)之nutch1.7安装
- nutch1.9与solr4.8.1整合
- nutch1.9--windows下nutch基本操作
- JDBC连结中Class.forName()详解
- BZOJ 1170 [Balkan2007]Cipher Hash
- Volley的使用笔记
- Installing Wireshark on Ubuntu 12.04 LTS
- android versionCode versionName的获取
- Nutch1.9安装
- A tricky way to create a lookup field in Visualforce page
- nginx编译和配置
- C程序中对时间的处理——time库函数详解以及系统时间结构体类型
- 联系方式!
- iOS 后台
- 如果是JS文件限制了你的页面加载速度,不用再担心了
- navcat for mysql 注册码
- html,添加iframe后,其他div看不见了