lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andraz Skoric <>
Subject Re: how to combine queries?
Date Tue, 06 Apr 2004 10:44:29 GMT
Amrun wrote:

>Thanks for your answers, 
>I've tried to use the MultiFieldQueryParser and it works quite good. But now
>I need to know how the operators like "+" or AND are working together? 
>I have a searchmask at which you can choose e.g. the title, subject, class,
>categoriy, teacher and so on and I need to combine the given keywords. 
>Say I want to get all the presentations from the class 5 from the teacher xy
>where the keywords are "security" "lucene" and so on. 
>So I would combine the "presentations" with the "5" and teacher "xy" with
>PLUS and the keywords with " "? I don't really know how this operators work
>Hope someone can help me
Try to use MultiFiledQueryParser I posted yesterday... when I came to 
the same problem as you I read that I sould create "virtual" field 
keywords or smth like that, but it didn't fit into my app, 'couse I had 
same values for different fields. So I created 2 new methods for mapping 
one on one for fields and query strings for that fields... I use those 
two methods in implementation of advanced search where user can search 
onto multiple fields whit condition of finding all or finding anything. 
It looks smth like that:

field1: query1
field2: query2
fieldN: queryN

If you need to find all, just use flags with value required and that 
works for my case.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message