Cómo importar datos desde mysql a solr
Estoy tratando de hacer la importación completa de db usando la siguiente URL
`127.0.0.1:8983/solr/dataimport?command=full-import`
Instalé solr y tratando de configurarlo. Cambié algunos archivos y puse detalles (los nombres de los archivos y el código agregado se describen a continuación). Pero cuando intento importar los datos de la tabla en formato solr json, se muestra el siguiente error:
HTTP ERROR 404
Problem accessing /solr/dataimport. Reason:
Not Found
Powered by Jetty://
¿Alguien puede decirme cuál es el problema real? ¿O mal configuré a Sorl?
Mi archivo data-config.xml tiene el siguiente código:
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/sq_dbLoveOffers"
user="pksqueak"
password="passwd"/>
<document>
<entity name="id"
query="select sq_prom_id, sq_prom_name, sq_prom_description, sq_latitude, sq_longitude from sq_offers">
</entity>
</document>
</dataConfig>
Agregué el siguiente código en Solrconfig.xml:
<lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
y
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
Agregué el siguiente código en schema.xmal FILE:
<fields>
<field name="sq_prom_id" type="string" indexed="true" stored="true" required="true" />
<field name="sq_prom_name" type="string" indexed="true" stored="true" />
<field name="sq_prom_description" type="string" indexed="true" stored="true" />
<field name="sq_latitude" type="string" indexed="true" stored="true" />
<field name="sq_longitude" type="string" indexed="true" stored="true" />
</fields>