lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert A. Decker" <dec...@robdecker.com>
Subject Re: QueryParser query inside a Boolean query?
Date Mon, 03 Jun 2002 19:01:27 GMT
uberQuery is a BooleanQuery. uberQuery.toString(null) in one example
search produces:
+type:MedicalInformation      +product:acticin      +name:He*

In this case, He* should return to me a document that has in its name the
word 'Head' (I can't remember but the full name of the document but is
something like 'Use in Treating Head Lice')

Instead, I can only get this document if I type the full word 'Head' (I
use a lowercase filter so 'head' works as well)

name is a QueryParser query, as is product. MedicalInformation is a
TermQuery.

These are added like:
uberQuery.add(typeQuery, true, false);
if (productQuery != null) uberQuery.add(productQuery, true, false);
if (nameQuery != null) uberQuery.add(nameQuery, true, false);

thanks,
rob

http://www.robdecker.com/
http://www.planetside.com/

On Mon, 3 Jun 2002, Peter Carlson wrote:

> What is your Query.toString(<defaultField>) for post QueryParser and post
> added BooleanQuery.
> 
> --Peter
> 
> On 6/3/02 11:38 AM, "Robert A. Decker" <decker@robdecker.com> wrote:
> 
> > I'm having a problem with my queries that I don't quite understand.
> > 
> > Say I create a Query object using QueryParser - this query lets the
> > user add wildcards, etc.
> > 
> > Then, I create another Query object using, for example, a TermQuery.
> > 
> > I then put both of these into a BooleanQuery and use that BooleanQuery
> > against the lucene index.
> > 
> > What I'm finding is that my wildcards are no longer followed by
> > lucene. For example, if the field passed to the QueryParser was:
> > investig*
> > 
> > Then, investig* is used in the query, but it doesn't behave as a wildcard
> > - it seems to actually search for phrase "investig*"
> > 
> > So, what do I do to use a mix of QueryParser terms, and TermQuerys? Do I
> > build up my BooleanQuery and then somehow run that through the QueryParser
> > again?
> > 
> > thanks,
> > rob
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message