Ah, I got it. retArray is an array of ints; in order to return the string value, it needs the mterms array to do the mapping. Thanks, Yonik!
Monsur > -----Original Message----- > From: Yonik Seeley [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 10, 2005 1:33 PM > To: java-user@lucene.apache.org > Subject: Re: Sorting: string vs int > > Here is a snippet of the current StringIndex class: > > public static class StringIndex { > /** All the term values, in natural order. */ > public final String[] lookup; > > /** For each document, an index into the lookup array. */ > public final int[] order; > } > > The order field is used for sorting within a single IndexSearcher, but > the lookup field is needed to populate the actual string value so it > may be used by MultiSearchers to order hits from multiple Searchers. > > Look at FieldSortedHitQueue.comparatorString() for more info. > > I guess it would be nice to have some way of telling the searcher (and > the fieldcache) whether the actual string values are needed or not... > it could save a lot of memory when there are a lot of unique terms. > > -Yonik > Now hiring -- http://forms.cnet.com/slink?231706 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]