Solr4.10.2集成Nutch1.9与自带UI界面使用

一、Solr4.10.2与Nutch1.9集成

环境:Solr4.10.2已经配置在Tomcat上

Solr的Tomcat配置详见Solr4.10.2的Tomcat配置

NUTCH_DIR/conf/schema-solr4.xml拷贝到SOLR_HOME/collection1/conf/,重命名为schema.xml,并在<fields>...</fields>最后添加一行

  1. <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>

重启Tomcat后即可用Nutch的crawl命令带上solrURL参数进行爬取索引工作了

Nutch1.9的命令使用详见Nutch1.9安装配置与基本使用介绍

在爬取索引后进入solr管理界面可以看到solr下已经有索引好的数据了:

二、Solr4.10.2的自带UI界面(Solritas)

1.拷贝solr-4.10.2\contrib\velocity\lib以及solr-4.10.2\dist下面的所有jar包到SOLR_SERVER\WEB-INF\lib目录下

2.如果不进行上一步集成Nutch,这一步就可以跳过了,如果集成了Nutch则需要在新的schema.xml文件中继续添加配置

①    在</types>前加上

  1. <!-- Money/currency field type. Seehttp://wiki.apache.org/solr/MoneyFieldType
  2. Parameters:
  3. defaultCurrency: Specifies thedefault currency if none specified. Defaults to "USD"
  4. precisionStep:   Specifies the precisionStep for the TrieLongfield used for the amount
  5. providerClass:   Lets you plug in other exchange providerbackend:
  6. solr.FileExchangeRateProvider is the default and takes one parameter:
  7. currencyConfig:name of an xml file holding exchange rates
  8. solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:
  9. ratesFileLocation:URL or path to rates JSON file (default latest.json on the web)
  10. refreshInterval:Number of minutes between each rates fetch (default: 1440, min: 60)
  11. -->
  12. <fieldType name="currency"class="solr.CurrencyField" precisionStep="8"defaultCurrency="USD" currencyConfig="currency.xml" />
  13. <!-- boolean type: "true" or "false" -->
  14. <fieldType name="boolean" class="solr.BoolField"sortMissingLast="true"/>
   <!-- Money/currency field type. Seehttp://wiki.apache.org/solr/MoneyFieldType
Parameters:
defaultCurrency: Specifies thedefault currency if none specified. Defaults to "USD"
precisionStep: Specifies the precisionStep for the TrieLongfield used for the amount
providerClass: Lets you plug in other exchange providerbackend:
solr.FileExchangeRateProvider is the default and takes one parameter:
currencyConfig:name of an xml file holding exchange rates
solr.OpenExchangeRatesOrgProvider uses rates from openexchangerates.org:
ratesFileLocation:URL or path to rates JSON file (default latest.json on the web)
refreshInterval:Number of minutes between each rates fetch (default: 1440, min: 60)
-->
<fieldType name="currency"class="solr.CurrencyField" precisionStep="8"defaultCurrency="USD" currencyConfig="currency.xml" /> <!-- boolean type: "true" or "false" -->

<fieldType name="boolean" class="solr.BoolField"sortMissingLast="true"/>

②    在</fields>前加上

  1. <field name="cat" type="string"indexed="true" stored="true" multiValued="true"/>
  2. <field name="manu_exact" type="string"indexed="true" stored="false"/>
  3. <field name="content_type" type="string"indexed="true" stored="true"multiValued="true"/>
  4. <field name="price" type="float" indexed="true"stored="true"/>
  5. <field name="popularity" type="int"indexed="true" stored="true" />
  6. <field name="inStock" type="boolean"indexed="true" stored="true" />
  7. <dynamicField name="*_s" type="string" indexed="true"  stored="true"/>
  8. <dynamicField name="*_c"  type="currency" indexed="true"  stored="true"/>
  9. <dynamicField name="*_dt" type="date"   indexed="true"  stored="true"/>
   <field name="cat" type="string"indexed="true" stored="true" multiValued="true"/>
<field name="manu_exact" type="string"indexed="true" stored="false"/>
<field name="content_type" type="string"indexed="true" stored="true"multiValued="true"/>
<field name="price" type="float" indexed="true"stored="true"/>
<field name="popularity" type="int"indexed="true" stored="true" />
<field name="inStock" type="boolean"indexed="true" stored="true" />
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_c" type="currency" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>

③    在</schema>前加上

  1. <copyField source="author" dest="author_s"/>
  2. <copyField source="price"dest="price_c"/>
 <copyField source="author" dest="author_s"/>
<copyField source="price"dest="price_c"/>

④    中文分词按照之前的方法配置就好,IK分词器配置详见Solr4.10.2的IK Analyzer分词器配置

3.重启Tomcat,访问http://localhost:8080/solr/browse即可

参考资料:Solr browse solritas的使用

nutch1.8+solr 4 配置过程+ikanalayzer2012 中文分词器

本文固定连接:http://blog.csdn.net/fyfmfof/article/details/42803841

Solr4.10.2集成Nutch1.9与自带UI界面使用的更多相关文章

  1. Solr4.10.3安装配置

    系统环境 window版本为:windows 8.1 64位 软件环境 JDK版本:1.7 solr版本:4.10.3 tomcat版本:tomcat 7 安装过程 步骤一:将下载好的solr-4.1 ...

  2. Tomcat部署Solr4.10.4

    前段时间学习solr,兴致勃勃的从官网下载到solr5.3.0最新版本,然后在后期部署时出现了很多问题.首先,4.0到5.0是个大版本更新,下载 的压缩包的文件结构有了很多变化,导致网上很多关于sol ...

  3. Win7下Solr4.10.1和MySql的整合(索引与搜索)

    1.打开D:\webserver\solr\collection1\conf\solrconfig.xml文件,在<requestHandler name="/select" ...

  4. Win7下Solr4.10.1和TomCat8的安装

    1.系统为win7 64位系统,安装有wamp的环境,我的所有网站放在 d:\webserver下,域名指向该目录下的子目录: 2.安装TomCat8到 D:\Tomcat 8.0: 3.在 d:\w ...

  5. Solr-4.10.2与Tomcat整合

    1.将下载的solr解压至D:\solr,拷贝d:\solr\solr-4.10.2\example\webapps\solr.war到Tomcat的webapps\目录中.直接解压 solr.war ...

  6. Solr4.10与tomcat整合并安装中文分词器

    1.solr Solr 是Apache下的一个顶级开源项目,采用Java开发,它是基于Lucene的全文搜索服务器.Solr提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展,并对索引. ...

  7. tomcat部署solr4.10

    1.创建solrHome mkdir /opt/solrHome 2.拷贝solr基础数据 /example/solr/* /opt/solrHome 将contrib和dist两个目录拷贝到/opt ...

  8. 10.Solr4.10.3数据导入(DIH全量增量同步Mysql数据)

    转载请出自出处:http://www.cnblogs.com/hd3013779515/ 1.创建MySQL数据 create database solr; use solr; DROP TABLE ...

  9. 9.Solr4.10.3数据导入(post.jar方式和curl方式)

    转载请出自出处:http://www.cnblogs.com/hd3013779515/ 1.使用post.jar方式 java -Durl=http://192.168.137.168:8080/s ...

随机推荐

  1. tinymce原装插件源码分析(七)-使能css、script

    在tinymce中使用css个script tinymce的编辑器中css和script默认是不起作用的.(编辑器主要面向写文章使用,考虑到xss攻击,默认是不启用的) 需要修改tinymce.js中 ...

  2. Map的四种遍历方法

    1.取值遍历 for(String key:map.keySet()){ System.out.println("key="+key+"and value=" ...

  3. RabbitMQ消息可靠性分析 - 简书

    原文:RabbitMQ消息可靠性分析 - 简书 有很多人问过我这么一类问题:RabbitMQ如何确保消息可靠?很多时候,笔者的回答都是:说来话长的事情何来长话短说.的确,要确保消息可靠不只是单单几句就 ...

  4. POJ——T1789 Truck History

    http://poj.org/problem?id=1789 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 27597   ...

  5. 图片3d轮放查看效果

    本功能比較简单,就是一个大幕.左右滚动播放图片. 关键点在于怎样实现平滑的滚动,包含动画效果,3d效果等. <style> img { position: absolute; top:20 ...

  6. C++ Primer Plus的若干收获--(三)

    有时候怀疑真是怀疑自己走的路究竟是不是正确的.作为一个土生土长数学系学生,却对数学毫无兴趣,没事的时候就喜欢躲在图书馆看看有关计算机的书.有时候期末考试时候会挂个一两门的数学专业课,有时候真希望数学课 ...

  7. bzoj4554: [Tjoi2016&Heoi2016]游戏(二分图匹配)

    4554: [Tjoi2016&Heoi2016]游戏 题目:传送门 题解: 一道很牛逼的匈牙利..和之前模拟赛的一道题有点相似(不过这题不用完美匹配) 我们可以把连续的行和列全部编号(如果之 ...

  8. 关于Tool接口--------hadoop接口:extends Configured implements Tool 和 ToolRunner.run

    我们在写Hadoop--map/reduce程序时,遇到使用按文件url来分析文件----------多表连接的DistributedCache方式,看不懂使用extends Configured i ...

  9. SSIS故障排除

    1.2015.09.10 SSIS部署到SQL Server上 JOB任务无法执行 说是sa账户没有执行权限 解决办法:1)SQL Server 启动时使用windows管理员账户登录.2)部署的数据 ...

  10. shiro动态控制url资源

    怎么利用shiro权限动态控制每个url资源呢?主要包括jsp(html)页面.action的url访问,而静态资源和登录资源则可直接访问. 所谓动态控制url就是url的权限控制不是手动写死在配置文 ...