solr 数据库配置文件 db-data-config.xml 和配置过滤html代码

<dataSource driver="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://localhost:1433/webmsg" user="sa" password="sa"/>

<!--数据库字符串的配置-->
    <document><!--
    transformer 格式转换:HTMLStripTransformer 索引中忽略HTML标签
    query:完全索引查询语句
    deltaQuery:增量索引查询主键ID
    deltaImportQuery:增量索引查询导入数据
    deletedPkQuery:增量索引删除主键ID查询
    -->

<dataConfig>
<dataSource driver="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://localhost:1433/webmsg" user="sa" password="sa"/>
    <document name="doc">
        <entity name="msg" pk="ID" transformer="HTMLStripTransformer" query="select * from msg" deltaQuery="select * from msg where msglastmodifytime > '${dataimporter.last_index_time}'">
            <field column="ID"/>
            <field column="MSGTITLE"/>
            <field column="MSGCONTENT" stripHTML="true"/><!--查询字段名,配置字段名,是否使用格式化-->
            <field column="MSGURL"/>
            <field column="MSGDATE"/>

           
        </entity>
    </document>
</dataConfig>

 

 

posted @ 2012-11-15 20:19  浪浪仔  阅读(5418)  评论(0编辑  收藏  举报