FAQ
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" <vnguyen@ur.com> 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupjava-user @
categorieslucene
postedSep 29, '06 at 8:21p
activeSep 30, '06 at 12:38a
posts3
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase