lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmg2 <>
Subject RE: embeded solrj doesn't refresh index
Date Wed, 17 Aug 2011 14:29:36 GMT
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:
Sent from the Solr - User mailing list archive at

View raw message