lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Artem Chereisky <a.cherei...@gmail.com>
Subject Re: How to include multiple terms in QueryWrapperFilter?
Date Tue, 11 May 2010 01:21:07 GMT
Bob,

my understanding is that you create a BooleanQuery and wrap it with
QueryWrapperFilter. Something like this:

            BooleanQuery booleanQuery = new BooleanQuery();
            TermQuery departmentQuery = new TermQuery(new Term("Department",
dept));
            TermQuery jobTitleQuery = new TermQuery(new Term("JobTitle",
jobTitle));
            booleanQuery.Add(departmentQuery, BooleanClause.Occur.MUST);
            booleanQuery.Add(jobTitleQuery, BooleanClause.Occur.MUST);
            QueryWrapperFilter queryWrapperFilter = new
QueryWrapperFilter(booleanQuery);

Regards,
Art


On Tue, May 11, 2010 at 11:00 AM, Bob Eastbrook <baconeater789@gmail.com>wrote:

> To only retrieve records belonging to a particular "Department", I use
> this:
>
> myFilter = New QueryWrapperFilter(New TermQuery(New Term("Department",
> dept)))
>
> How can I include another Term in this filter, such as
> Term("JobTitle", jobTitle)?  That is to say, how does one create a
> filter with 2 terms?
>
> This is in Lucene 2.3.1.
>
> Bob
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message