Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use the Solr Data Import Handler to index a MySQL table?
    primarykey
    data
    text
    <p>When I try to import a mysql table by loading this in the browser:</p> <pre><code>http://192.168.136.129:8983/solr/dataimport?command=full-import </code></pre> <p>I get this error:</p> <pre><code>HTTP ERROR 404 Problem accessing /solr/dataimport. Reason: NOT_FOUND Powered by Jetty:// </code></pre> <p>I'm following this tutorial from the official Solr wiki to get started with the DIH:</p> <p><a href="http://wiki.apache.org/solr/DIHQuickStart" rel="nofollow">http://wiki.apache.org/solr/DIHQuickStart</a></p> <p>As per the tutorial I added this to my solrconfig.xml:</p> <pre><code>&lt;requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"&gt; &lt;lst name="defaults"&gt; &lt;str name="config"&gt;data-config.xml&lt;/str&gt; &lt;/lst&gt; &lt;/requestHandler&gt; </code></pre> <p>in data-config.xml I have the following:</p> <pre><code>&lt;dataConfig&gt; &lt;dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/site" user="root" password="123"/&gt; &lt;document&gt; &lt;entity name="profiles" query="select user_id,about,music,movies,occupation from profiles"&gt; &lt;/entity&gt; &lt;/document&gt; &lt;/dataConfig&gt; </code></pre> <p>And these are the fields defined in my schema.xml:</p> <pre><code> &lt;fields&gt; &lt;field name="user_id" type="string" indexed="true" stored="true" required="true" /&gt; &lt;field name="about" type="string" indexed="true" stored="true" /&gt; &lt;field name="music" type="string" indexed="true" stored="true" /&gt; &lt;field name="movies" type="string" indexed="true" stored="true" /&gt; &lt;field name="occupation" type="string" indexed="true" stored="true" /&gt; &lt;field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/&gt; &lt;/fields&gt; &lt;uniqueKey&gt;user_id&lt;/uniqueKey&gt; </code></pre> <p>So what am I doing wrong? I imagine it may have something to do with the data-config.xml file. In it I don't know if a certain path to the MySQL driver is being assumed. I downloaded the MySQL JDBC driver from here:</p> <p><a href="http://dev.mysql.com/downloads/connector/j/3.1.html" rel="nofollow">http://dev.mysql.com/downloads/connector/j/3.1.html</a></p> <p>and put it in my <code>/solr/lib</code> directory.</p> <p>When I downloaded the driver and extracted it there was a bunch of folders inside one folder called "mysql-connector-java-3.0.17-ga".</p> <p>I do notice that inside that there is a dir called: <code>com</code> and inside that <code>mysql</code> and inside that <code>jbdc</code> and inside that there is a file called <code>Driver.class</code>.</p> <p>Is this what is being referenced from data-config.xml? If so why isn't the initial directory not mentioned.</p> <p>Basically I have no idea what the issue is, can someone help please.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload