On Mar 4, 2009, at 12:47 AM, The Flight Captain wrote:
Thanks for the DirectSolrConnection tip, that eliminated the need for parsing the XML as a string, and all that code need to instantiate a container. I am now Using SolrCore.getSolrCore(). This method is deprecated though, what is the standard way of instaniating a SoreCore to pass it as a parameter to
DirectSolrConnection?

The DirectSolrConnection( String instanceDir, String dataDir, String loggingPath ) constructor has this code:

CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir)); SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null); CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir()); IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null); core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);

        Erik

Reply via email to