我正在研究将数据从MySql索引到Solr。以下是我在此命令后收到的响应XML:localhost:8080 / solr / dataimport?command = full-import& flush = true
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">5</int></lst>
<lst name="initArgs"><lst name="defaults">
<str name="config">data-config.xml</str></lst></lst>
<str name="command">full-import</str><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">2599</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2012-12-04 11:51:45</str>
<str name="">Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.</str>
<str name="Committed">2012-12-04 11:51:46</str><str name="Total Documents Processed">0</str>
<str name="Time taken">0:0:1.112</str></lst
><str name="WARNING">This response format is experimental. It is likely to change in the future.</str></response>
索引应该在数据目录下的索引目录中吗? 我尝试通过Luke GUI查看它,它没有显示任何内容,我甚至能够在这里正确创建索引吗? (我的Sql查询只返回一列,并且在schema.xml中定义了字段类型)
这是我的data-config.xml:
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/mydb" user="root" password="123"/>
<document>
<entity name="procname" query="Select ap.procname from cur_aprocedures ap
left join test_data ts on ts.procid = ap.procid">
<field column="procname" name="procname" />
</entity>
答案 0 :(得分:1)
启用提交时使用完整导入选项。这会将数据提交到solr索引中,并可用于搜索 如果您正在从Web UI屏幕进行DIH,通常您会有一个Commit复选框,需要选择Solr才能在DIH循环结束后提交更改。