Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 95764 invoked from network); 2 Aug 2004 07:43:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Aug 2004 07:43:03 -0000 Received: (qmail 9172 invoked by uid 500); 2 Aug 2004 07:42:55 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 9092 invoked by uid 500); 2 Aug 2004 07:42:54 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 9076 invoked by uid 99); 2 Aug 2004 07:42:54 -0000 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=HTML_50_60,HTML_MESSAGE X-Spam-Check-By: apache.org Received: from [207.234.147.17] (HELO mail2.s2lmail.com) (207.234.147.17) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 02 Aug 2004 00:42:51 -0700 Received: (qmail 8219 invoked by uid 508); 2 Aug 2004 07:42:52 -0000 Received: from unknown (HELO infact12) (61.11.66.46) by mail2.s2lmail.com with SMTP; 2 Aug 2004 07:42:52 -0000 Message-ID: <006201c47865$2128ab80$0448170a@infact12> From: "lingaraju" To: "Lucene Users List" Subject: Having common word in the search Date: Mon, 2 Aug 2004 13:18:38 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005F_01C47893.39493080" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_005F_01C47893.39493080 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear All Searcher searcher =3D new IndexSearcher("C:/index"); Analyzer analyzer =3D new StandardAnalyzer(); String line=3D"curry asia"; =20 line=3Dline+"recipe"; String fields[] =3D new String[2]; fields[0] =3D "title"; fields[1] =3D "contents"; Query q =3D MultiFieldQueryParser.parse(line,fields,analyzer); Hits hits1 =3D searcher.search(q); In the above code Hits will return the documnet that contains the word=20 1)"Curry OR asia OR recipe" 2)"Curry OR asia AND recipe" 3)"Curry AND asia AND recipe" 4)"Curry AND asia OR recipe" But I want the result should be Like this=20 1)"Curry AND asia AND recipe" 2)("Curry OR asia) AND recipe" My question is how to give the condition Actually my requirement is like this=20 User will enter some text in "text box" it may be one word or two word = or n word.(Eg "curry asia") but when i am searching i will append "recipe" word in the search string = so the search must contains "recipe" word. Finally search should contains 1)"Curry AND asia AND recipe" 2)("Curry OR asia) AND recipe" search should not contains 1)"Curry AND asia OR recipe" 2)"Curry OR asia OR recipe" Thanks and regards Raju ------=_NextPart_000_005F_01C47893.39493080--