lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kiran Joisher" <>
Subject RE: searching in more than fields on document
Date Tue, 06 Jun 2006 09:52:06 GMT
You can use MultiFieldQueryParser

Something like this

Query query = MultiFieldQueryParser.parse(new String[]{queryString,
queryString, queryString}, new String[]{ASSET_TITLE, ASSET_ARTICLE,
ASSET_DIRECTOR_NAMES }, new BooleanClause.Occur[]
{BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD }, analyzer);

Kiran Dama
Senior Software Engineer

Recreate Solutions - Architects of Digital Convergence
106, Marwah's Complex, Krishnalal Marwah Marg, Saki Naka, Andheri (E),
Mumbai 400 072 
T: +91 22 2857 6944 / 45  F: +91 22 2857 1123  M: +91 

This electronic mail transmission and any accompanying documents contain
information belonging to the sender ("Information") that may be confidential
and legally privileged. If you are not the intended recipient, any
disclosure, copying, distribution or action taken in reliance on the
Information is strictly prohibited. If you have received the Information in
error, please contact the sender by reply email and destroy all copies of
the original email. Thank you
-----Original Message-----
From: Amaresh Kumar Yadav [] 
Sent: Tuesday, June 06, 2006 1:08 PM
Subject: searching in more than fields on document

Hi All,

      Will u please give me some clue for searching on more than one field
of document.

My document has six field and i want to search on three fields. 

Presently I am able to search on only TITLE field..

 query = QueryParser.parse(queryString, "TITLE", analyzer);


Amaresh Yadav


This email and any files transmitted with it are confidential and are solely
for the use of the individual or entity to which it is addressed. Any use,
distribution, copying or disclosure by any other person is strictly
prohibited. If you receive this transmission in error, please notify the
sender by reply email and then destroy the message. Opinions, conclusions
and other information in this message that do not relate to official
business of the company shall be understood to be neither given nor endorsed
by NIIT Ltd. or NIIT Technologies Ltd. Any information contained in this
email, when addressed to Clients is subject to the terms and conditions in
governing client contract.

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

Scanned by  eScan  Anti-Virus  and  Content Security Software.
Visit for more info on eScan and MailScan.

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

View raw message