开发者社区> 问答> 正文

solr3.4 配置索引mysql 失败:报错

使用solr中自带的example,能够读取到mysql表中的数据数量,但是用luke查看索引为0;

配置文件如下:

data-config.xml

__________________________

<dataConfig>   

  <dataSource type="JdbcDataSource"   

              driver="com.mysql.jdbc.Driver"   

              url="jdbc:mysql://192.168.1.5/test"   

              user="root"   

              password="l#2zh4en" />   

   

<document name="documents1" >

        <entity name="documents" transformer="ClobTransformer"

          query="select id,title,content,adtime from info"

          deltaImportQuery="select  id,title,content,adtime  from info where ID='${dataimporter.delta.id}'"

          deltaQuery="select id  from info where adtime > '${dataimporter.last_index_time}'"

          deletedPkQuery="select id  from info where id=0"

        >

            <field column="id" name="id" />

            <field column="title" name="title" />

            <field column="CONTENT" name="content" clob="true" />

            <field column="adtime" name="adtime" />

        </entity>

  </document>  

</dataConfig>    

_______________________________________________________________

schema.xml

_______________________________________________________________

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

<field name="title" type="text" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true"/>

<field name="content" type="text" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true"/>

<field name="adtime" type="date" indexed="false" stored="true"/>

_______________________________________________________________

请各位高手指教,非常感谢!

展开
收起
kun坤 2020-06-07 16:04:26 471 0
1 条回答
写回答
取消 提交回答
  • 我遇到过,试着在dataSource 配置中加上  batchSize="-1"######感谢指点,我最终换了配置文件,测试成功,

    2020-06-07 16:04:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像