Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 93415 invoked from network); 2 Jul 2009 16:37:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jul 2009 16:37:54 -0000 Received: (qmail 24567 invoked by uid 500); 2 Jul 2009 16:38:05 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 24515 invoked by uid 500); 2 Jul 2009 16:38:04 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 24505 invoked by uid 99); 2 Jul 2009 16:38:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 16:38:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 16:38:02 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 278FF118AE for ; Thu, 2 Jul 2009 16:37:42 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: solr-commits@lucene.apache.org Date: Thu, 02 Jul 2009 16:37:41 -0000 Message-ID: <20090702163742.4430.35390@eos.apache.org> Subject: [Solr Wiki] Update of "Solrj" by ShalinMangar X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification. The following page has been changed by ShalinMangar: http://wiki.apache.org/solr/Solrj The comment on the change is: Fixing usage of EmbeddedSolrServer to not use deprecated APIs ------------------------------------------------------------------------------ {{{ - SolrCore core = SolrCore.getSolrCore(); + // Note that the following property could be set through JVM level arguments too + System.setProperty("solr.solr.home", "/home/shalinsmangar/work/oss/branch-1.3/example/solr"); + CoreContainer.Initializer initializer = new CoreContainer.Initializer(); + CoreContainer coreContainer = initializer.initialize(); - SolrServer server = new EmbeddedSolrServer( core ); + EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, ""); - ... }}} If you want to use MultiCore features, then you should use this: {{{ - File home = new File( getSolrHome() ); + File home = new File( "/path/to/solr/home" ); File f = new File( home, "solr.xml" ); - multicore.load( getSolrHome(), f ); + CoreContainer container = new CoreContainer(); + container.load( "/path/to/solr/home", f ); - EmbeddedSolrServer server = new EmbeddedSolrServer( multicore, "core name as defined in solr.xml" ); + EmbeddedSolrServer server = new EmbeddedSolrServer( container, "core name as defined in solr.xml" ); ... }}}