Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 87747 invoked from network); 28 Oct 2010 10:21:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Oct 2010 10:21:16 -0000 Received: (qmail 93954 invoked by uid 500); 28 Oct 2010 10:21:15 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 93633 invoked by uid 500); 28 Oct 2010 10:21:15 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 93626 invoked by uid 99); 28 Oct 2010 10:21:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Oct 2010 10:21:14 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of karl.wright@nokia.com designates 192.100.105.134 as permitted sender) Received: from [192.100.105.134] (HELO mgw-mx09.nokia.com) (192.100.105.134) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Oct 2010 10:21:07 +0000 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o9SAKcb2021952 for ; Thu, 28 Oct 2010 05:20:46 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 28 Oct 2010 13:20:26 +0300 Received: from vaebh101.NOE.Nokia.com ([10.160.244.22]) by esebh102.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 28 Oct 2010 13:20:26 +0300 Received: from smtp.mgd.nokia.com ([65.54.30.6]) by vaebh101.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 28 Oct 2010 13:20:21 +0300 Received: from 008-AM1MMR1-004.mgdnok.nokia.com (65.54.30.59) by NOK-am1MHUB-02.mgdnok.nokia.com (65.54.30.6) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 28 Oct 2010 12:20:21 +0200 Received: from 008-AM1MPN1-001.mgdnok.nokia.com ([169.254.1.156]) by 008-AM1MMR1-004.mgdnok.nokia.com ([65.54.30.59]) with mapi; Thu, 28 Oct 2010 12:20:21 +0200 From: To: Subject: RE: ArrayIndexOutOfBounds exception using FieldCache Thread-Topic: ArrayIndexOutOfBounds exception using FieldCache Thread-Index: Act12eTm3OwTbKMeTYunrHY0v+60f////CkA//6d8QA= Date: Thu, 28 Oct 2010 10:15:52 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 28 Oct 2010 10:20:21.0953 (UTC) FILETIME=[BA5E4B10:01CB7689] X-Nokia-AV: Clean Not good indeed. Synched to trunk, blew away old indexes, reindexed, same behavior. So I th= ink we've got a problem, Houston. ;-) Karl -----Original Message----- From: ext Michael McCandless [mailto:lucene@mikemccandless.com]=20 Sent: Wednesday, October 27, 2010 11:08 AM To: dev@lucene.apache.org Subject: Re: ArrayIndexOutOfBounds exception using FieldCache Hmmm not good! It could be you are hitting https://issues.apache.org/jira/browse/LUCENE-2633? That was fixed on Sep 9, after your code. Maybe try syncing up? Mike On Wed, Oct 27, 2010 at 9:21 AM, wrote: > Hi Folks, > > I just tried to index a data set that was probably 2x as large as the > previous one I'd been using with the same code.=A0 The indexing completed > fine, although it was slower than I would have liked. ;-)=A0 But the foll= owing > problem occurs when I try to use FieldCache to look up an indexed and sto= red > value: > > java.lang.ArrayIndexOutOfBoundsException: -65406 > =A0=A0=A0=A0=A0=A0=A0 at > org.apache.lucene.util.PagedBytes$Reader.fillUsingLengthPrefix(PagedBytes= .java:98) > =A0=A0=A0=A0=A0=A0=A0 at > org.apache.lucene.search.FieldCacheImpl$DocTermsImpl.getTerm(FieldCacheIm= pl.java:918) > =A0=A0=A0=A0=A0=A0=A0 at ... > > The code that does this has been working for quite some time and has been > unmodified: > > =A0=A0=A0 /** Find a string field value, given the lucene ID, field name,= and > value. > =A0=A0=A0 */ > =A0=A0=A0 protected String getStringValue(int luceneID, String fieldName) > =A0=A0=A0=A0=A0 throws IOException > =A0=A0=A0 { > =A0=A0=A0=A0=A0 // Find the right reader > =A0=A0=A0=A0=A0 final int idx =3D readerIndex(luceneID, starts, readers.l= ength); > =A0=A0=A0=A0=A0 final int docBase =3D starts[idx]; > =A0=A0=A0=A0=A0 final IndexReader reader =3D readers[idx]; > > =A0=A0=A0=A0=A0 BytesRef ref =3D > FieldCache.DEFAULT.getTerms(reader,fieldName).getTerm(luceneID-docBase,ne= w > BytesRef()); > =A0=A0=A0=A0=A0 String rval =3D ref.utf8ToString(); > =A0=A0=A0=A0=A0 //System.out.println(" Reading luceneID "+Integer.toStrin= g(luceneID)+" > field "+fieldName+" with result '"+rval+"'"); > =A0=A0=A0=A0=A0 return rval; > =A0=A0=A0 } > > =A0 } > > I added a try/catch to see what values were going into the key line: > > catch (RuntimeException e) > =A0=A0=A0 { > =A0=A0=A0=A0=A0=A0=A0 System.out.println("LuceneID =3D "+luceneID+", > fieldName=3D'"+fieldName+"', idx=3D"+idx+", docBase=3D"+docBase); > =A0=A0=A0=A0=A0=A0=A0 System.out.println("Readers =3D "+readers.length); > =A0=A0=A0=A0=A0=A0=A0 int i =3D 0; > =A0=A0=A0=A0=A0=A0=A0 while (i < readers.length) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 { > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 System.out.println(" Reader= start "+i+" is "+starts[i]); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i++; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0=A0 throw e; > =A0=A0=A0 } > > The resulting output was: > > LuceneID =3D 34466856, fieldName=3D'id', idx=3D0, docBase=3D0 > Readers =3D 1 > =A0=A0=A0=A0 Reader start 0 is 0 > > . which looks reasonable on the face of things.=A0 This is a version of t= runk > from approximately 8/12/2010, so it is fairly old.=A0 Was there a fix for= a > problem that could account for this behavior?=A0 Should I simply synch up= ?=A0 Or > am I doing something wrong here?=A0 The schema for the id field is: > > indexed=3D"true" stored=3D"true"/> > > > Karl > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org