Yet another Solr 4 new user. I admired what is Solr able to do in full text searching, but the on-line documentation is a little bit frustrating. Anyway, I’m working on importing my MySQL database (having few millions of records) to Solr.
- I downloaded the Java connector and save it in the
example/libdirectory. -
I created
data-config.xmland put within it:<document name="doc"> <entity name="pagey" query="SELECT * FROM page"> <field column="id" name="pid" /> <field column="Content" name="pcontent" /> <field column="bid" name="bid" /> <field column="Num" name="num" /> </entity> </document>and saved it in:
/example/solr/collection1/conf. -
Linked that file to
solrconfig.xmlby adding:<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler> -
Modified schema.xml to add my new fields.
But when I arrived to perform full importing by interring: http://[localhost]:8983/solr/dataimport?command=full-import I got this error: HTTP ERROR 404 Problem accessing /solr/dataimport. Reason: Not Found. I think this is no more valid in the last version 4. So I tried: http://[localhost]:8983/solr/#/collection1/dataimport?command=full-import but nothing happens.
My fields have been successfully added, I can see them on the admin panel in the schema browser section in collection1.
From the admin -> collection1 -> Dataimport, it show: sorry, no dataimport-handler defined!.
Running the start.jar doesn’t show errors.
What am I missing right here?
EDIT: After solving it, remember that “XML is case-sensitive”.
You data-config needs to look more like this. You are not specifying a mysql host, user, or password.
You need to include this in your solrconfig.xml file.
and
In solr.xml you need to make sure you have the following