我是solr的新手,并尝试使用它为我的数据库“ zend”和表“ users”建立索引。以下是/ solr / example / solr / conf /文件夹中的data-config.xml代码<dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/zend" user="root" password=""/> <document> <entity name="id" query="select id,first_name,last_name from users"> <field column="id" name="solr_id"/> <field column="first_name" name="solr_first_name"/> <field column="last_name" name="solr_last_name"/> </entity> </document></dataConfig>下面的代码我放在位于/ solr / example / solr / conf文件夹中的solrconfig.xml中<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst></requestHandler>这些字段是我在/ solr / example / solr / conf文件夹的schema.xml中添加的<field name="solr_id" type="genericID" indexed="true" stored="true"/><field name="solr_first_name" type="textgen" indexed="true" stored="true"/><field name="solr_last_name" type="textgen" indexed="true" stored="true"/>进行这些更改后,我运行java -jar start.jar当我从浏览器点击完整的导入命令时http://localhost:8983/solr/dataimport?command=full-import然后我得到错误: HTTP错误:500 solr配置中存在严重错误。 检查您的日志文件以获取有关可能出问题的更多详细信息。 如果您希望solr在配置错误后继续运行,请更改: 假 无效请指教。 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 您的config-文件中存在配置错误。例如,这可能是语法错误,缺少结束标记或类似的东西。您的解决方案写在您的问题上:Check your log files for more detailed information on what may be wrong.因此,请检查您的java-container的输出...。可能是java -jar命令的输出或java和/或start.jar生成的日志文件。..并在此处发布输出关于mysql - 使用solr搜索mysql数据库表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8585813/ (adsbygoogle = window.adsbygoogle || []).push({});