Return-Path: Delivered-To: apmail-lucene-solr-user-archive@locus.apache.org Received: (qmail 2808 invoked from network); 3 Jun 2008 05:39:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jun 2008 05:39:58 -0000 Received: (qmail 56464 invoked by uid 500); 3 Jun 2008 05:39:54 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 56432 invoked by uid 500); 3 Jun 2008 05:39:54 -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 56421 invoked by uid 99); 3 Jun 2008 05:39:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 22:39:54 -0700 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: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 05:38:59 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 5B6D971C234; Mon, 2 Jun 2008 22:39:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 58D1571C10A for ; Mon, 2 Jun 2008 22:39:21 -0700 (PDT) Date: Mon, 2 Jun 2008 22:39:21 -0700 (PDT) From: Chris Hostetter To: solr-user@lucene.apache.org Subject: Re: NullPointerException at lucene.analysis.StopFilter with 1.3 In-Reply-To: <15f47ea0805301045kb459838t7ab986d880c13a8e@mail.gmail.com> Message-ID: References: <15f47ea0805301045kb459838t7ab986d880c13a8e@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : I'm just looking into transitioning from solr 1.2 to 1.3 (trunk). I : have some legacy handler code (called "AdvancedRequestHandler") that : used to work with 1.2 but now throws an exception using 1.3 (latest : nightly build). The exception is this: The short answer is: right after you call "stopFilter.init(args)" call "stopFilter.inform(solrCore.getSolrConfig().getResourceLoader());" This is an interesting use case that wasn't really considered when we switched away from using hte SolrCore singlton and the the ResourceLoaderAware interface was added. we made sure things would still work for people who had their own custom Analysis Factories, but some of the functionality in *existing* Factories was moved from the init() method to inform() ... which means the classes aren't technically backwards compatibly for people doing what you're doing: constructing them directly. When I have some more time, i'll spin up a thread on solr-dev to discuss what we should do about this -- n the mean time feel free to file a bug that StopFilter isn't backwards compatible. FWIW: constructing a new TokenizerChain inside your RequestHandlers handeRequest method seems .... unneccessary. if nothing else, you could do this in your init method and reuse the TokenizerChain on every request. but if it were me, I'd just use the schema.xml to declare a fieldtype that had the behavior i want, and then use schema.getFieldType("specialType").getQueryAnalyzer().tokenStream(...) -Hoss