QueryParser can do that for you - something like: QueryParser qp = new QueryParser( "CONTENTS" , new StandardAnalyzer() ); qp.setDefaultOperator ( Operator.AND ); Query q = qp.parse ( "TOOLS FOR TRAILER" );
Result query should be: +content:tools +content:trailer "Van Nguyen" <[EMAIL PROTECTED]> wrote on 29/09/2006 13:16:19: > I have a field in my index that is being tokenized using the > StandardAnalyzer. Let’s say that field was: > > TOOLS FOR TRAILER > > The word “FOR” is a stop word so it is not being indexed (based on > the StandardAnaylzyer). When someone types in TOOLS FOR TRAILER in, > I have a BooleanQuery search for: > > +CONTENTS:tools +CONTENTS:for +CONTENTS:trailer > > Which will result in no match because of the “AND” search on > “+CONTENTS:for”. > > Do I have to have any logic to stripe the BooleanQuery of any stop > words used in the StandardAnalyzer? > > Van > > United Rentals > Consider it done.™ > 800-UR-RENTS > unitedrentals.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]