lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poeta simbolista <poetasimboli...@gmail.com>
Subject SolrJ - open existing index in EmbeddedSolrServer - query mode
Date Fri, 09 Oct 2009 10:11:34 GMT

Hi,
I'm trying to open an existing local index with the following code:


/**
 * get the SolrServer
 */
public static SolrServer startEmbeddedSolr(String indexdir) throws
IOException,
    ParserConfigurationException, SAXException,
    SolrServerException 
    {
		final CoreContainer container = new CoreContainer();
		SolrCore core = new SolrCore(indexdir, null);
		container.register("querychecker", core, false);
		final SolrServer solr = new EmbeddedSolrServer(container, "querychecker");		
		return solr;
}

// Use the server to load an index.
public void check(String indexdir)
{ 
		SolrServer server = SolrHelper.startEmbeddedSolr(indexdir);
...
}


This code is called passing an existing index, say /tmp/output
But this code, instead of opening an existing index and read it and make
queries against it, it just creates a new one,
in /tmp/output/index 

Is this something configurable somehow? There's not much documentation about
it, and all examples and running code I see, they create an index and then
play with it - not take an existing one.
How can I make an EmbeddedSolrServer open an already existing index instead
of creating a new one?
Is it different if I use a CommonsHttpSolrServer? 

Thanks a lot in advance for your help.

-- 
View this message in context: http://www.nabble.com/SolrJ---open-existing-index-in-EmbeddedSolrServer---query-mode-tp25818657p25818657.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message