You should not use the same indexDir for your "normal" Lucene index (for searching), and for the AnalyzingInfixSuggester.
The two are completely different, and AnalyzingInfixSuggester happily overwrites the entire index you passed it when you call its build method. I'll fix the javadocs to try to make this clear. They are misleading now ... Mike McCandless http://blog.mikemccandless.com On Tue, Apr 15, 2014 at 8:42 PM, Neil Bacon <neil.ba...@nicta.com.au> wrote: > Hi, > Not sure if this is user error or a bug. AnalyzingInfixSuggester.build() > appears to be deleting the stored fields in my index. > > Please see the attached unit test. > > test1: creates an index > test2: debug logs stored fields, searches it > test3: does AnalyzingInfixSuggester.build() and looks up some prefixes > (similar to AnalyzingInfixSuggesterTest) > test4: creates a fresh AnalyzingInfixSuggester (no build) and looks up some > prefixes (similar to AnalyzingInfixSuggesterTest) > test5: repeat of test2, but this time the index has no stored fields and it > fails > > The dog food server uses AnalyzingInfixSuggester and it searches OK. Could > it be searching a version of the index unmodified by > AnalyzingInfixSuggester.build()? > > Any ideas appreciated. > > Once this is sorted out I've got a modified AnalyzingInfixSuggester to try > that should handle a field with multiple values (AnalyzingInfixSuggester > only uses the first of multiple values). > > Cheers, > > Neil. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org