环境:
操作系统:Mac OS X Lion
Nutch版本:1.4
Eclipse版本:Eclipse Java EE IDE for Web Developers. Indigo
第一步:新建普通Java工程
第二步:将Nutch源码(路径是:Nutch根目录下“src/java/”下所有的文件)拷贝到java工程中的src目录下。
第三步:将Nutch运行依赖包加到class path中去。依赖包可以在Nutch根目录下runtime/local/lib文件夹中找到,
切记不可全选,请排除nutch-1.4.jar,否则当运行的时候,会首先去nutch-1.4.jar中寻找配置文件。可能会报http.agent.name异常。
第四步:将runtime/local/下的conf和plugins文件夹拷贝到java工程中去。此时,文件结构大致如下所示:
第五步:右键工程-》Properties-》Build Path-》选择Libraries-》点击Add Class Folder-》选择conf文件夹-》点击确定
第六步:右键Crawl.java文件-》Run As-》Run Configurations-》切换到Arguments选项卡-》加入运行参数,我的是官方例子中的参数,既:
urls -solr http://localhost:8080/solr/ -depth 3 -topN 5
因为我在早先配置好了solr,所以我的参数中带有solr的地址,大伙儿可以自行配置所需参数。
PS:我在运行中,solr端抛出unknown field content异常,在schema.xml文件中也配置了相关参数,但是还是不行,希望走过路过的大侠可以帮忙解决一下这个问题,help you help me.谢谢各位。
unknown field ""异常已经解决,附上schema.xml
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="notch" version="1.4">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"
omitNorms="true"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0"
omitNorms="true" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
omitNorms="true" positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" precisionStep="0"
omitNorms="true" positionIncrementGap="0"/>
<fieldType name="text" class="solr.TextField"
positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1"
catenateWords="1" catenateNumbers="1" catenateAll="0"
splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="url" class="solr.TextField"
positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1"/>
</analyzer>
</fieldType>
<fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
</types>
<fields>
<dynamicField name="*" type="ignored" multiValued="true" />
<field name="id" type="string" stored="true" indexed="true"/>
<field name="tstamp" type="date" stored="true" indexed="false" />
<!-- core fields -->
<field name="segment" type="string" stored="true" indexed="false"/>
<field name="digest" type="string" stored="true" indexed="false"/>
<field name="boost" type="float" stored="true" indexed="false"/>
<!-- fields for index-basic plugin -->
<field name="host" type="url" stored="false" indexed="true"/>
<field name="site" type="string" stored="false" indexed="true"/>
<field name="url" type="url" stored="true" indexed="true"
required="true"/>
<field name="content" type="text" stored="false" indexed="true"/>
<field name="title" type="text" stored="true" indexed="true"/>
<field name="cache" type="string" stored="true" indexed="false"/>
<field name="stamp" type="date" stored="true" indexed="false"/>
<!-- fields for index-anchor plugin -->
<field name="anchor" type="string" stored="true" indexed="true"
multiValued="true"/>
<!-- fields for index-more plugin -->
<field name="type" type="string" stored="true" indexed="true"
multiValued="true"/>
<field name="contentLength" type="long" stored="true"
indexed="false"/>
<field name="lastModified" type="date" stored="true"
indexed="false"/>
<field name="date" type="date" stored="true" indexed="true"/>
<!-- fields for language identifier plugin -->
<field name="lang" type="string" stored="true" indexed="true"/>
<!-- fields for sub collection plugin -->
<field name="sub collection" type="string" stored="true"
indexed="true" multiValued="true"/>
<!-- fields for feed plugin (tag is also used by microformats-reltag)-->
<field name="author" type="string" stored="true" indexed="true"/>
<field name="tag" type="string" stored="true" indexed="true" multiValued="true"/>
<field name="feed" type="string" stored="true" indexed="true"/>
<field name="publishedDate" type="date" stored="true"
indexed="true"/>
<field name="updatedDate" type="date" stored="true"
indexed="true"/>
<!-- fields for creative commons plugin -->
<field name="cc" type="string" stored="true" indexed="true"
multiValued="true"/>
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>content</defaultSearchField>
<solrQueryParser defaultOperator="OR"/>
</schema>
- 大小: 23 KB
分享到:
相关推荐
nutch1.4帮助文档,学习nutch1.4必备,最新nutch1.4核心类解读!
nutch1.4 在windows下的安装配置环境搭建
nutch 1.4 在windows下安装配置
Nutch是一个由Java实现的,刚刚诞生开放源代码(open-source)的web搜索引擎。Nutch目前最新的版本为version1.4。这个为nutch的最新版 1.4。
apache-nutch-1.4-bin.tar.gz.part2
Nutch1[1].4_windows下eclipse配置图文详解
eclipse配置nutch,eclipse配置nutch
apache-nutch-1.4-bin.part2
apache-nutch-1.4-bin.part1
Eclipse 编译 Nutch-0.9
apache-nutch-1.4-bin.tar.gz.part1
apache-nutch-2.2.1(Eclipse直接运行版)今天刚做的,发现有很多坑,分享给大家实验,JDK1.7 Win10。我分享的两个压缩卷一起下载才可以用,资源限制太小了 002地址:...
1.1 环境准备 1.1.1 本期引言 1.1.2 环境介绍 1.1.3 JDK 安装配置 1.1.4 ANT 安装配置 1.1.5 IvyDE 安装配置 1.1.5 Tomcat 安装配置 1.1.6 Cygwin 安装配置 1.2 Eclipse 开发 ...1.2.3 Solr 与Nutch 结合
Nutch 是一个开源Java 实现的搜索引擎。这里是它的安装包。
Eclipse 中编译 Nutch-1.0 运行源代码
Windows下使用Eclipse配置Nutch2图文详解
很好的一个开源搜索引擎,可以自己设计添加代码。
nutch 在windows下环境搭配 已经如何在eclipse下配置,有配图,很详细
里面描述了Nutch的基本流程,Nutch与eclipse的结合,Nutch与Solr的结合
本文章修改了在eclipse中加入Nutch的详细过程!