I am implementing a search that allows the user to toggle the Soundex and Stem functionality on and off. When the Soundex or Sten functions are not on, the search will use the StandardAnalyzer as default. I implemented the Soundex (SoundexAnalyzer from book Lucene In Action) and Stem (SnowballAnalyzer) analyzer successfully individually. They only work if I use the analyzers during both indexing and searching. The problem I have is that I seem to have to use one of the three analyzers or nothing. I heven't been able to combine them. The following may help better to understand what I am trying to achieve. Any help would be greatly appreciated.
Indexing ======== Index using recursive TokenStream object. public TokenStream tokenStream(String fieldName, Reader reader) { TokenStream result = new SoundexFilter ( new SnowballFilter ( new StopFilter ( new LowerCaseFilter ( new StandardFilter ( new StandardTokenizer(reader))), StandardAnalyzer.STOP_WORDS))); return result; } Searching ========== If user selects Soundex function, use SoundexAnalyzer in query. Else if user selects Stem option, use SnowballAnalyzer in query. Else use StandardAnalyzer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Daniel Clark, Senior Consultant Sybase Federal Professional Services 6550 Rock Spring Drive, Suite 800 Bethesda, MD 20817 Office - (301) 896-1103 Office Fax - (301) 896-1604 Mobile - (703) 403-0340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]