lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanoc5 <sean...@gmail.com>
Subject Sanity check: ResonseWriter directly to a database?
Date Thu, 03 Sep 2009 21:56:10 GMT

Hello all,
Are there any hidden gotchas--or even basic suggestions--regarding
implementing something like a DBResponseWriter that puts responses right
into a database? My specific questions are:

1) Any problems adding non-trivial jars to a solr plugin? I'm thinkin JDBC
and then perhaps Hibernate libraries? 
I don't believe so, but I have just enough understanding to be dangerous at
the moment.

2) Is JSONResponseWriter a reasonable copy/paste starting point for me?  Is
there anything that might match better, especially regarding initialization
and connection pooling?

3) Say I have a read-write single-core solr server: a vanilla-out-of-the-box
example install. Can I concurrently update the underlying index safely with
EmbeddedSolrServer? (This is my backup approach, less preferred)
I assume "no", one of them has to be read only, but I've learned not to
under-estimate the lucene/solr developers.  

I'm starting with adapting JSONResponseWriter and the 
http://wiki.apache.org/solr/SolrPlugins wiki notes . The docs seem to
indicate all I need to do is package up the appropriate supporting (jdbc)
jar files into my MyDBResponse.jar, and drop it into the ./lib dir (e.g.
c:\solr-svn\example\solr\lib). Of course, I need to update my solrconfig.xml
to use the new DBResponseWriter.

Straight straight JDBC seems like the easiest starting point. If that works,
perhaps move the DB stuff to hibernate.  Does anyone have a "best practice"
suggestion for database access inside a plugin? I rather expect the answer
might be "use JNDI and well-configured hibernate; no special problems
related to 'inside' a solr plugin." I will eventually be interested in
saving both query results and document indexing information, so I expect to
do this in both a (custom) ResponseWriter, and ... um... a
DocumentAnalysisRequestHandler?   

I realize embedded solr might be a better choice (performance has been a big
issue in my current implementation), and I am looking into that as well. If
feasible, I'd like to keep solr "in charge" of the database content through
plugins and extensions, rather than keeping both solr and db synced from my
(grails) app. 
Thanks,

Sean


-- 
View this message in context: http://www.nabble.com/Sanity-check%3A-ResonseWriter-directly-to-a-database--tp25284734p25284734.html
Sent from the Solr - User mailing list archive at Nabble.com.


Mime
View raw message