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

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>最后添加一行

<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>前加上

   <!-- 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>前加上

   <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>前加上

 <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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值