lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: NullPointerException at lucene.analysis.StopFilter with 1.3
Date Tue, 03 Jun 2008 05:39:21 GMT

: 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


Mime
View raw message