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 
e: @recreatesolutions.com  
Website: www.recreatesolutions.com 
 
CONFIDENTIALITY NOTICE

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 [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 06, 2006 1:08 PM
To: java-user@lucene.apache.org
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);

Regards..

Amaresh Yadav

----------------------------------------------------------------------
DISCLAIMER

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**************************************************************
Scanned by  eScan  Anti-Virus  and  Content Security Software.
Visit http://www.mwti.net for more info on eScan and MailScan.
**************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to