Hi,
would it be possible that you instantiate a new instance of your SolrServer
every time you do a query?
You should use the code you quoted in your mail once during initialization
to create an instance of SolrServer (the interface being implemented by
EmbeddedSolrServer) and subsquently use the query method of SolrServer to
do the query.
Cheers,
Sven
--On Sonntag, 7. Februar 2010 21:54 +0530 Ranveer Kumar
<ranveer.s...@gmail.com> wrote:
Hi All,
I am still very new to solr.
Currently I am facing problem to use EmbeddedSolrServer.
following is my code:
File home = new
File("D:/ranveer/java/solr_home/solr/first");
CoreContainer coreContainer = new CoreContainer();
SolrConfig config = null;
config = new SolrConfig(home + "/core1","solrconfig.xml",null);
CoreDescriptor descriptor = new CoreDescriptor(coreContainer,"core1",home
+ "/core1");
SolrCore core = new SolrCore("core1", home+"/core1/data", config, new
IndexSchema(config, "schema.xml",null), descriptor);
coreContainer.register(core.getName(), core, true);
final EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer,
"core1");
Now my problem is every time when I making request for search SolrCore is
initializing the core.
I want if the core/instance of core is already start then just use
previously started core.
Due to this problem right now searching is taking too much time.
I tried to close core after search but same thing when fresh search result
is made, solr is starting from very basic.
please help..
thanks