您的位置:首页 > 其它

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

2011-11-23 13:48 148 查看
在工程中找到“solrindex-mapping.xml”修改如下:

<fields>

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

<field dest="cache_content" source="cache_content"/>[/b]
[/b]
<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"/>[/b]
<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查询返回结果如下所示:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息