Hi, I am trying to index a row in my database in solr from my java application. I have added the necessary banks, but I keep getting this error. My solr schema is correct, and I make a request, just add a new row to my database, and I want it to be indexed as well
Here is the error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html
Here is my code
public class indexSolr { private Connection conn = null; private static HttpSolrServer server; private Collection docs = new ArrayList(); private int _totalSql = 0; private long _start = System.currentTimeMillis(); public static void main(String[] args) throws SolrServerException, IOException, SQLException { String url = "http://localhost:8983/solr/db"; indexSolr idxer = new indexSolr(url); idxer.doSqlDocuments(); idxer.endIndexing(); } private void doSqlDocuments() throws SQLException { try { Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection( "jdbc:postgresql://localhost:5432/biz_cat", "postgres", "pos"); java.sql.Statement st = null; st = conn.createStatement(); ResultSet rs = st.executeQuery("select * from pl_biz order by id DESC LIMIT 1"); while (rs.next()) { SolrInputDocument doc = new SolrInputDocument(); Integer id = rs.getInt("id"); String name = rs.getString("name"); String midname = rs.getString("midname"); String lastname = rs.getString("lastname"); String frlsname = rs.getString("frlsname"); String biz_subject = rs.getString("biz_subject"); String company_type = rs.getString("company_type"); String obshtina = rs.getString("obshtina"); String main_office_town = rs.getString("main_office_town"); String address = rs.getString("address"); String role = rs.getString("role"); String country = rs.getString("country"); String nace_code = rs.getString("nace_code"); String nace_text = rs.getString("nace_text"); String zip_code = rs.getString("zip_code"); String phone = rs.getString("phone"); String fax = rs.getString("fax"); String email = rs.getString("email"); String web = rs.getString("web"); String location = rs.getString("location"); String geohash = rs.getString("geohash"); Integer popularity = rs.getInt("popularity"); doc.addField("id", id); doc.addField("name", name); doc.addField("midname", midname); doc.addField("lastname", lastname); doc.addField("frlsname", frlsname); doc.addField("biz_subject", biz_subject); doc.addField("company_type", company_type); doc.addField("obshtina", obshtina); doc.addField("main_office_town", main_office_town); doc.addField("address", address); doc.addField("role", role); doc.addField("country", country); doc.addField("nace_code", nace_code); doc.addField("nace_text", nace_text); doc.addField("zip_code", zip_code); doc.addField("phone", phone); doc.addField("fax", fax); doc.addField("email", email); doc.addField("web", web); doc.addField("location", location); doc.addField("geohash", geohash); doc.addField("popularity", popularity); docs.add(doc); ++_totalSql; if (docs.size() > 1) {
source share