RE: embeded solrj doesn't refresh index

2011-08-17 Thread mmg2
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.


RE: embeded solrj doesn't refresh index

2011-07-29 Thread Jianbin Dai
Thanks Marc.  
Guess I was not clear about my previous statement. So let me rephrase.

I use DIH to import data into solr and do indexing. Everything works fine.

I have another embedded solr server setting to the same index files. I use
embedded solrj to search the index file.

So the first solr is for indexing purpose, it can be turned off once the
indexing is done.

However the changes in the index files cannot show up from embedded solrj,
that is, once the new index is built, from embedded solrj, I still get the
old results. Only after I restart the embedded solr server, the new changes
are reflected from solrj.  The embedded solrj works like there was a caching
that it always goes to first.

Thanks.

JB


-Original Message-
From: Marc Sturlese [mailto:marc.sturl...@gmail.com] 
Sent: Friday, July 22, 2011 1:57 AM
To: solr-user@lucene.apache.org
Subject: RE: embeded solrj doesn't refresh index

Are u indexing with full import? In case yes and the resultant index has
similar num of docs (that the one you had before) try setting reopenReaders
to false in solrconfig.xml
* You have to send the comit, of course.

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



RE: embeded solrj doesn't refresh index

2011-07-22 Thread Marc Sturlese
Are u indexing with full import? In case yes and the resultant index has
similar num of docs (that the one you had before) try setting reopenReaders
to false in solrconfig.xml
* You have to send the comit, of course.

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


Re: embeded solrj doesn't refresh index

2011-07-20 Thread Marco Martinez
You should send a commit to you embedded solr

Marco Martínez Bautista
http://www.paradigmatecnologico.com
Avenida de Europa, 26. Ática 5. 3ª Planta
28224 Pozuelo de Alarcón
Tel.: 91 352 59 42


2011/7/20 Jianbin Dai j...@huawei.com

 Hi,



 I am using embedded solrj. After I add new doc to the index, I can see the
 changes through solr web, but not from embedded solrj. But after I restart
 the embedded solrj, I do see the changes. It works as if there was a cache.
 Anyone knows the problem? Thanks.



 Jianbin




RE: embeded solrj doesn't refresh index

2011-07-20 Thread Jianbin Dai
Hi Thanks for response. Here is the whole picture:
I use DIH to import and index data. And use embedded solrj connecting to the
index file for search and other operations.
Here is what I found: Once data are indexed (and committed), I can see the
changes through solr web server, but not from embedded solrj. If I restart
the embedded solr server, I do see the changes.
Hope it helps. Thanks.


-Original Message-
From: Marco Martinez [mailto:mmarti...@paradigmatecnologico.com] 
Sent: Wednesday, July 20, 2011 5:09 AM
To: solr-user@lucene.apache.org
Subject: Re: embeded solrj doesn't refresh index

You should send a commit to you embedded solr

Marco Martínez Bautista
http://www.paradigmatecnologico.com
Avenida de Europa, 26. Ática 5. 3ª Planta
28224 Pozuelo de Alarcón
Tel.: 91 352 59 42


2011/7/20 Jianbin Dai j...@huawei.com

 Hi,



 I am using embedded solrj. After I add new doc to the index, I can see the
 changes through solr web, but not from embedded solrj. But after I restart
 the embedded solrj, I do see the changes. It works as if there was a
cache.
 Anyone knows the problem? Thanks.



 Jianbin





RE: embeded solrj doesn't refresh index

2011-07-20 Thread Jianbin Dai
Hi Thanks for response. Here is the whole picture:
I use DIH to import and index data. And use embedded solrj connecting to the
index file for search and other operations.
Here is what I found: Once data are indexed (and committed), I can see the
changes through solr web server, but not from embedded solrj. If I restart
the embedded solr server, I do see the changes.
Hope it helps. Thanks.

-Original Message-
From: Marco Martinez [mailto:mmarti...@paradigmatecnologico.com] 
Sent: Wednesday, July 20, 2011 5:09 AM
To: solr-user@lucene.apache.org
Subject: Re: embeded solrj doesn't refresh index

You should send a commit to you embedded solr

Marco Martínez Bautista
http://www.paradigmatecnologico.com
Avenida de Europa, 26. Ática 5. 3ª Planta
28224 Pozuelo de Alarcón
Tel.: 91 352 59 42


2011/7/20 Jianbin Dai j...@huawei.com

 Hi,



 I am using embedded solrj. After I add new doc to the index, I can see the
 changes through solr web, but not from embedded solrj. But after I restart
 the embedded solrj, I do see the changes. It works as if there was a
cache.
 Anyone knows the problem? Thanks.



 Jianbin





embeded solrj doesn't refresh index

2011-07-19 Thread Jianbin Dai
Hi,

 

I am using embedded solrj. After I add new doc to the index, I can see the
changes through solr web, but not from embedded solrj. But after I restart
the embedded solrj, I do see the changes. It works as if there was a cache.
Anyone knows the problem? Thanks.

 

Jianbin