Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 59461 invoked from network); 22 Feb 2008 21:38:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 21:38:23 -0000 Received: (qmail 13073 invoked by uid 500); 22 Feb 2008 21:38:11 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 13047 invoked by uid 500); 22 Feb 2008 21:38:11 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 13036 invoked by uid 99); 22 Feb 2008 21:38:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 13:38:11 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [129.2.12.68] (HELO FCMD70350.fc-md.umd.edu) (129.2.12.68) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 22 Feb 2008 21:37:36 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Problem in Coding, to get the DOC ID from HITS Date: Fri, 22 Feb 2008 16:34:34 -0500 Message-ID: <87111BD4606C7846BC0D55244EFADC37A27DFB@FCMD70350.fc-md.umd.edu> In-Reply-To: <15641665.post@talk.nabble.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem in Coding, to get the DOC ID from HITS Thread-Index: Ach1mipOJrDSUyifQLOgo50gEa6xXwAAEHnQ References: <15641665.post@talk.nabble.com> From: "Dharmalingam Ganesan" To: X-Virus-Checked: Checked by ClamAV on apache.org Of course, these are programming errors nothing really related to Lucene. Hits hits; Int hitCount =3D hits.length This does not make sense. You have just declared hits. It must be created before using it. The second error should disapper if you add throws declaration or try/catch block. By the way, avoid asking such questions in this forum because the questions are not related to Lucene!! -----Original Message----- From: sumittyagi [mailto:ping.sumit@gmail.com]=20 Sent: Friday, February 22, 2008 4:32 PM To: java-user@lucene.apache.org Subject: Problem in Coding, to get the DOC ID from HITS here is my code package db; import java.io.*; import java.util.*; import java.lang.*; import org.apache.lucene.search.Hits; import org.apache.lucene.search.Hit; public class comm{ public static void main(String[] args) { System.out.println("hi"); =09 =09 Hits hits; int hitCount =3D hits.length(); for (int i=3D0;ijavac db/comm.java db/comm.java:15: variable hits might not have been initialized int hitCount =3D hits.length(); ^ db/comm.java:17: unreported exception java.io.IOException; must be caught or dec lared to be thrown int docId =3D hits.id(i) ; ^ 2 errors any help please.. --=20 View this message in context: http://www.nabble.com/Problem-in-Coding%2C-to-get-the-DOC-ID-from-HITS-t p15641665p15641665.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org