谢谢,我编辑了data-config.xml文件

就像这样

<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lol"
user="root"
password="n"/>

<document name="content">
<entity name="id">
query="SELECT id from foo"
 </entity>
</document>
</dataConfig>


当我跑步

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


在浏览器上我得到了

<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="Time Elapsed">0:0:6.299</str><str name="Total Requests made to DataSource">1</str><str name="Total Rows Fetched">0</str><str name="Total Documents Processed">0</str><str name="Total Documents Skipped">0</str><str name="Full Dump Started">2013-06-28 11:17:34</str><str name="">Indexing failed. Rolled back all changes.</str><str name="Rolledback">2013-06-28 11:17:34</str></lst><str name="WARNING">This response format is experimental. It is likely to change in the future.</str></response>

最佳答案

我认为配置应该看起来更像(注意,查询应该是entity元素的属性):



  <document name="content">
    <entity name="id" query="SELECT id from foo">
      <!--I assume you have a field in Solr and a column in MySQL, both of which are named "id"-->
    </entity>
  </document>

关于mysql - HTTP错误500 prbm访问/solr/dataimport无法配置solr,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17335700/

10-15 20:22