Nutch1.3集成Solr3.4网页快照功能实现(四)

在工程中找到“solrindex-mapping.xml”修改如下:

<fields>

        <field dest="content" source="content"/>

 

        <field dest="cache_content" source="cache_content"/>

 

        <field dest="site" source="site"/>

        <field dest="title" source="title"/>

        <field dest="host" source="host"/>

        <field dest="segment" source="segment"/>

        <field dest="boost" source="boost"/>

        <field dest="digest" source="digest"/>

        <field dest="tstamp" source="tstamp"/>

        <field dest="id" source="url"/>

        <copyField source="url" dest="url"/>

    </fields>

Solr应用中修改“schema.xml”添加对应的Field,如下:

<field name="url" type="string" indexed="true" stored="true"/>

  <field name="content" type="textMaxWord" indexed="true" stored="true"/>

  <field name="cache_content" type="binary" indexed="false" stored="true"/>

  <field name="segment" type="string" indexed="false" stored="true"/>

  <field name="boost" type="float" indexed="true" stored="true"/>

  <field name="digest" type="string" indexed="false" stored="true"/>

  <field name="host" type="string" indexed="true" stored="false"/>

  <field name="cache" type="string" indexed="true" stored="false"/>

  <field name="site" type="string" indexed="true" stored="false"/>

  <field name="anchor" type="string" indexed="true" stored="false" multiValued="true"/>

  <field name="tstamp" type="string" indexed="false" stored="true"/>

重启服务,大功告成,solr查询返回结果如下所示:

 本文转自william_xu 51CTO博客,原文链接:http://blog.51cto.com/williamx/722720,如需转载请自行联系原作者

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值