SearchScale / dataimporthandler

Repository for DIH (Document Import Handler)
Apache License 2.0
68 stars 48 forks source link

This doesnt work with postgresql #43

Closed sajiljosephs closed 1 year ago

sajiljosephs commented 1 year ago

Steps tried:

  1. Setup mariadb, configured dataimporthandler and was able to do full-import for a table with 10000 rows in less than 2 seconds - Success
  2. Setup fresh postgresql database, configured dataimporthandler. Added postgresql jdbc from https://jdbc.postgresql.org/download/postgresql-42.6.0.jar.

Error ERROR (Thread-34) [] o.a.s.h.d.DataImporter Full Import failed => java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: org.postgresql.driver Processing Document # 1 at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:274) java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: org.postgresql.driver Processing Document # 1

  1. Setup fresh postgresql database, configured dataimporthandler. Added lib to include in solrconfig.xml for both dataimporthandler jar and postgresql jar files Added request handlers in solrconfig.xml Changed in data-config.xml >> <dataSource type="JdbcDataSource" driver="org.postgresql.driver" url="jdbc:postgresql://127.0.0.1:5432/test" user="test" password="test123"/> Reloaded the collection. Now there isn't any error in solr logs. But its not connecting to database. We are able to directly connect to the db outside solr with the logins provided in the data-config.xml

This looks like something is wrong with the data-import-handler-9.0.0.jar which processes only mariadb. It would be great if you can have a check and provide a fix for this issue including postgresql java client into the project

zniff commented 1 year ago

Hi I think the driver is case sensitive and it should be:

org.postgresql.Driver

sajiljosephs commented 1 year ago

Still the same error:

ERROR (Thread-23) [] o.a.s.h.d.DataImporter Full Import failed => java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: org.postgresql.Driver Processing Document # 1 at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:274) java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: org.postgresql.Driver Processing Document # 1

sajiljosephs commented 1 year ago

This issue is fixed by adding lib files to server/lib and server/lib/ext folder Please close