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

最新文章

  1. 关于css样式1
  2. Windows Phone App Studio 无码开发手机应用
  3. 可拖动FPS显示框(UGUI)
  4. HDU 5057 Argestes and Sequence --树状数组(卡内存)
  5. C++程序结构---1
  6. VS2010提示error TRK0002: Failed to execute command解决方法
  7. 【Hadoop环境搭建】Centos6.8搭建hadoop伪分布模式
  8. 【多线程】Java并发编程:Lock(转载)
  9. MingW编译virt-viewer
  10. Qt: qobject_cast&lt;QPushButton*&gt;(sender()) 简化信号与槽的编写
  11. java Date日期去掉时分秒
  12. Mysql学习(慕课学习笔记1)启动、登录及常用命令
  13. Slide-out Sidebar Menu
  14. Oracle 使用sql创建表空间及用户
  15. 第三周 数据分析之概要 Pandas库入门
  16. LOJ-10095(缩点的特殊使用)
  17. vue中异步函数async和await的用法
  18. [leetcode]67. Add Binary 二进制加法
  19. 运用Zabbix实现内网服务器状态及局域网状况监控(5) —— Zabbix监控路由器
  20. 弟三周作业之VS2015

热门文章

  1. BZOJ 3307 雨天的尾巴 (树上差分+线段树合并)
  2. Android开发进度07
  3. poj2411 Mondriaan's Dream (状压dp+多米诺骨牌问题)
  4. NetApp 存储的常用概念普及
  5. 今天修了一个bug,关于debug日志的问题
  6. 面试书上一些题目的整理:O(n)复杂度排序年龄 &amp; 青蛙跳台阶
  7. 推断CPU 是小端存储(Little endian)还是大端存储(Big endian)模式
  8. ValidForm的使用
  9. sizeof()函数的使用——————【Badboy】
  10. spring boot系统学习(知识点笔记)