solrj - How to configure and run Solr full dataimport from MySQL using Java? -


i want run dataimport in solr using java. have gone through link solrj full-import not working, there have given how run full import command java, , in other links found how query solr indexed data, requirement is, data import write configuration file below

<?xml version="1.0" encoding="utf-8" ?> <dataconfig> <datasource type="jdbcdatasource"              driver="com.mysql.jdbc.driver"             url="jdbc:mysql://localhost:3306/test_db"              user="root"              password="cloudera"/> <document>   <entity name="emp"       query="select id,name emp">      <field column="id" name="id"/>      <field column="name" name="name"/>          </entity> </document> </dataconfig> 

and configuration file information provide in solrconfig.xml below

<requesthandler name="/dataimport" class="org.apache.solr.handler.dataimport.dataimporthandler">         <lst name="defaults">             <str name="config">db-data-config.xml</str>         </lst> </requesthandler>  

but requirement is, don't want configure xml file above, want java ,so need set configurations have given in above xml java code itself,i.e below

params.set("datasource","jdbcdatasource")  params.set("driver","com.mysql.jdbc.driver") params.set("url","jdbc:mysql://localhost:3306/test_db") params.set("user","cloudera") params.set("password","cloudera"),etc. 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -