lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Khengare" <>
Subject How to give AND condition in MultiFieldSearchQueryParser?
Date Fri, 16 Jun 2006 07:25:44 GMT


            I want to search in multiple fields with "AND" condition
that is, If I have fields for employee


Field ("empNum","EC02261");

Field ("empPurchaseDept","john");

Field ("empAccountDept","john");

Field ("age","Aegentina");


Now I want to search in "PurchaseDept" & "AccountDept" for empName But
Only if that employee exist in both department.

So If I will search for john it should give me corresponding document
because it contents in both fields.


I can use MultiFieldSearchQueryParser. But what about "AND" condition.
if I search then it should present in both fields i.e. Purchase &
Account then n then it should return result.


Can I use BooleanClause.Occur.MUST?



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