I think the best way to tokening/stem is to use the analyzer directly. for example:
TokenStream ts = analyzer.tokenStream(field, new StringReader(text)); Token token = null; while ((token = ts.next()) != null) { Term newTerm = new Term(field, token.termText()); //do something with the new newTerm } If your just stemming then there will be only a single token so you probably won't need the while loop. On Monday 01 May 2006 12:37, Michael Chan wrote: > Hi, > > I'm trying to build a SpanQuery using word stems. Is parsing each term > with a QueryParser, constructed with an Analyzer giving stemmed > tokenStream, the right approach? It just seems to me that QueryParser is > designed to parse queries, and so my hunch is that there might be a > better way. > > Any help will be much appreciated. > > Michael > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]