索引mysql表后检索数据

时间:2010-02-21 16:29:04

标签: solr

即使在索引mysql表之后,在solr中也无法在查询之后检索数据

http://localhost:8983/solr/select/?q=slno:5

我的data-config.xml文件是:

<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>
    <dataSource type="JdbcDataSource"
                  driver="com.mysql.jdbc.Driver"
                  url="jdbc:mysql://localhost:3306/lbs"
                  user="user"
                  password="password"/>

    <document name="lbs">
        <entity name="radar_places"
                  query="select * from radar_places"

           deltaImportQuery="SELECT * FROM radar_places WHERE slno='${dataimporter.delta.slno}'"
  deltaQuery="SELECT slno FROM radar_places WHERE modified > '${dataimporter.last_index_time}'" >
            <field column="slno" name="slno" />
            <field column="place_id" name="place_id" />
            <field column="name" name="name" />
            <field column="geo_rss_point" name="geo_rss_point" />
        <field column="url" name="url" />
        <field column="location_id" name="location_id" />
        <field column="time" name="time" /> 
       </entity>
    </document>
</dataConfig>

在我使用过的浏览器中

http://localhost:8983/solr/dataimport?command=full-import

稍后我检查了命令http://localhost:8983/solr/dataimport/的状态

我得到了这个

<response>
−
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
</lst>
−
<lst name="initArgs">
−
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="status">idle</str>
<str name="importResponse"/>
−
<lst name="statusMessages">
<str name="Total Requests made to DataSource">1</str>
<str name="Total Rows Fetched">1151</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2010-02-21 07:53:14</str>
−
<str name="">
Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
</str>
<str name="Committed">2010-02-21 07:53:24</str>
<str name="Optimized">2010-02-21 07:53:24</str>
<str name="Total Documents Processed">0</str>
<str name="Total Documents Failed">1151</str>
<str name="Time taken ">0:0:10.56</str>
</lst>
−
<str name="WARNING">
This response format is experimental.  It is likely to change in the future.
</str>
</response>

1)这是否必须对<str name="Total Documents Failed">1151</str>

执行任何操作

无法弄清楚什么是错误的。

1 个答案:

答案 0 :(得分:3)

您确定数据导入配置与Solr文档架构匹配吗?