Hello again! I'm playing around some more with Lucene's automata, and I've bumped into something unexpected but can't figure out if its a bug or an error on my part.
briefly: Is it possible to use a single string automaton (i.e. the result of Automata.makeString( String ) ) to intersect a Terms instance? I keep getting NPE's on every attempt at doing this... e.g. this code: // where "term" is a term known to exist in someField CompiledAutomaton ca = new CompiledAutomaton( Automata.makeString( "term" ) ); Terms terms = leafReader.terms( someField ); TermsEnum tEnum = terms.intersect( ca, null ); results in: Exception in thread "main" java.lang.NullPointerException at org.apache.lucene.codecs.blocktree.IntersectTermsEnum.<init>(IntersectTermsEnum.java:127) at org.apache.lucene.codecs.blocktree.FieldReader.intersect(FieldReader.java:185) I assume I'm doing something wrong (I am aware that using an automaton for a single term may be a bad idea, but bear with me), but the fact that it's throwing an NPE prompted me to come and ask... Maybe there's a problem with encodings? Any help greatly appreciated. jta. -- entia non sunt multiplicanda praeter necessitatem