我的solr主页未显示任何错误。但它没有从所需的表中获取信息。
DATA-CONFIG.XML
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/market_place" user="root" password="student" batchSize="1" />
<document name="persons">
<entity name="courses" query="SELECT * FROM courses">
<field column="id" name="id"/>
<field column="name" name="name"/>
<field column="duration" name="duration"/>
<field column="fee" name="fee"/>
<!-- <field column="UNIVERSITY" name="university"/> -->
</entity>
</document>
</dataConfig>
我在solrconfig.xml中所做的更改
<lib dir="../../contrib/dataimporthandler/lib" regex=".*\.jar" />
<lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
<lib dir="../../dist/" regex="mysql-connector-java-\d.*\.jar" />
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
schema.xml中的更改
<field name="id" type="string" indexed="true" stored="true"/>
<field name="name" type="string" indexed="true" stored="true"/>
<field name="duration" type="string" indexed="true" stored="true"/>
<field name="fee" type="double" indexed="true" stored="true"/>