kratika sharma kratika sharma - 1 month ago 40
Apache Configuration Question

how to import and index data from database in solr 6.2.1(New to solr)

I am trying to index data from MySql,bt when execute it from solr admin, it only shows: Request:1, Fetched:0, Skipped:0

New to solr. Please help.

Answer

Take a look at your log, from the Solr Admin Panel, if there's any hint about the indexing process, at the url /solr/#/~logging if you see any error while trying to importing documents, clicking on the log line will give you additional information about the error.

Since you're mentioning Solr Admin I guess you're using the Data Import Handler.

Here is a very (very!) basic configuration, assuming you're indexing from mysql:

<dataConfig>
    <dataSource type="JdbcDataSource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://yourhost:3306/db_name"
    user="mysql_user"
    password="mysql_password"/>
      <document>
      <entity name="mydocuments" 
         query="select id, field1, field2, field3 from yourtable;">

      </entity>
    </document>
  </dataConfig>

When running the indexer, check these two checkboxes:

Commit: to execute a commit after the import

Auto-Refresh Status: to updated the import stats while it's running

Also, check if in your schema is defined a field version

<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>

Please let me know if it helped.

Comments