On Tue, Aug 23, 2011 at 10:25 PM, samuele.mattiuzzo <samum...@gmail.com> wrote: > I wrote my custom update handler for my solr installation, using jdbc to > query a mysql database. Everything works fine: the updater queries the db, > gets the data i need and update it in my documents! Fantastic! > > Only issue is i have to open and close a mysql connection for every document > i read. Since we have something like 10kk indexed document, i was thinking > about opening a mysql connection at the very beginning of the indexing > process, keeping it stored somewhere and use it inside my custom update > handler. When the whole indexing process is complete, the connection should > be closed. [...]
If you are using a custom update handler, then I imagine that it is up to you to keep a persistent connection open. You could also consider using the Solr DataImportHandler, http://wiki.apache.org/solr/DataImportHandler . This can interface with mysql, and does keep a persistent connection open. Regards, Gora