I'm having the same problem: I import my data using the DataImportHandler.
When the DIH runs, I see the changes in the index file. However, when I
query the index using SolrJ, the new results don't show up. I have to
restart my server to see the results using SolrJ. This is how I use solrj:

private static final SolrServer solrServer = initSolrServer();

        private static SolrServer initSolrServer() {
                try {
                        CoreContainer.Initializer initializer = new 
CoreContainer.Initializer();
                        coreContainer = initializer.initialize();
                        EmbeddedSolrServer server = new 
EmbeddedSolrServer(coreContainer, "");
                        return server;
                } catch (Exception ex) {
                        logger.log(Level.SEVERE, "Error initializing SOLR 
server", ex);
                        return null;
                }
        }


Is it wrong to declare the SolrServer as static final? Should I create a new
EmbeddedSolrServer for each query?

--
View this message in context: 
http://lucene.472066.n3.nabble.com/embeded-solrj-doesn-t-refresh-index-tp3184321p3261772.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to