Return-Path: Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: (qmail 98951 invoked from network); 29 Sep 2009 23:20:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Sep 2009 23:20:23 -0000 Received: (qmail 55609 invoked by uid 500); 29 Sep 2009 23:20:21 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 55532 invoked by uid 500); 29 Sep 2009 23:20:21 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 55522 invoked by uid 99); 29 Sep 2009 23:20:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 23:20:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jason.rutherglen@gmail.com designates 209.85.221.195 as permitted sender) Received: from [209.85.221.195] (HELO mail-qy0-f195.google.com) (209.85.221.195) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 23:20:11 +0000 Received: by qyk33 with SMTP id 33so5368254qyk.29 for ; Tue, 29 Sep 2009 16:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9debNfHhMIqVwTKaYFSEDCTbcVm6lj6iVvNSgAXwFUs=; b=kLnw3PSSS7Rs1wOVWQnPgs3e1/1mTt4eeLdURLo2XH1tBwlBHJXmaw4ZzhX1qlT+XB blF4yVFhhBjZkaoY21hNM3oeRMn8zxLmlOyuyTAjhfE4/uVpAchIevUW5pCENHqzzFJ8 PjzQG6cdV5AJxdAH+lSM4mvDJmF74vmserxMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=swqDfmMF9/828r4SvG4cQIUH321ol+nZ0uU0WbrPBwwSonfHoEWqGHoV+HteFv+014 usoVq5ZSN/ruqXMVbgAVZeZDn0nD1CQhH5ifKN+wePEha5MyT329c/u6lTTzYm8TuQEo ZvXE69pHo6UJ9hITxGqIc349viUjZmaWQSg6I= MIME-Version: 1.0 Received: by 10.224.82.9 with SMTP id z9mr525047qak.119.1254266389939; Tue, 29 Sep 2009 16:19:49 -0700 (PDT) In-Reply-To: <4AC294B2.4020808@gmail.com> References: <85d3c3b60909291549p3c0a8bf8v571f4dd3fbb73552@mail.gmail.com> <4AC291D2.1060103@gmail.com> <85d3c3b60909291605k2a7a3eb2pdf4311f726d887e0@mail.gmail.com> <4AC294B2.4020808@gmail.com> Date: Tue, 29 Sep 2009 16:19:49 -0700 Message-ID: <85d3c3b60909291619r108ad4e1qb15cd4c2676fd58f@mail.gmail.com> Subject: Re: Get access to CoreContainer From: Jason Rutherglen To: solr-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I'll just allow the user to pass in the port via a param for now. Thx! On Tue, Sep 29, 2009 at 4:13 PM, Mark Miller wrote: > Unfortunately, because they don't want you counting on access to the > servlet request due to embedded Solr and what not, to get that type of > info you have to override and use your own SolrDispatchFilter: > > =A0protected void execute( HttpServletRequest req, SolrRequestHandler > handler, SolrQueryRequest sreq, SolrQueryResponse rsp) { > > =A0 =A0// a custom filter could add more stuff to the request before > passing it on. > =A0 =A0// for example: sreq.getContext().put( "HttpServletRequest", req )= ; > > > Jason Rutherglen wrote: >> Yah, I just found it, and was going to reply to my own message with >> that exactly! >> >> My next question is how to get the port the request was on? >> >> On Tue, Sep 29, 2009 at 4:01 PM, Mark Miller wro= te: >> >>> Jason Rutherglen wrote: >>> >>>> Howdy, >>>> >>>> I was wondering what the best way is to access the current >>>> instance of CoreContainer? It seems like the only way to do this >>>> is to extend CoreAdminHandler. I'd prefer a way via a way to >>>> access CoreContainer from SolrCore or RequestHandlerBase. >>>> >>>> The use case is, I want to implement a SearchHandler that by >>>> default, searches all of the local cores by automatically >>>> inserting a shards param of the form >>>> "localhost:8080/solr/core0,localhost:8080/solr/core1" into the >>>> request. I'll be dynamically creating and unloading cores and so >>>> do not want to edit solrconfig each time a core changes. >>>> >>>> Thanks! >>>> >>>> >>> SolrCore.getCoreDescriptor().getCoreContainer() >>> >>> -- >>> - Mark >>> >>> http://www.lucidimagination.com >>> >>> >>> >>> >>> > > > -- > - Mark > > http://www.lucidimagination.com > > > >