lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <>
Subject Re: Sorting: string vs int
Date Thu, 10 Nov 2005 18:32:35 GMT
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.

Now hiring --

On 11/10/05, Monsur Hossain <> wrote:
> Thanks Yonik, it makes sense now.  So getStringIndex indexes every sorted
> string field in the retArray (one per document), and then each unique string
> term in the mterms array.  What is the purpose of the mterms array?
> Thanks,
> Monsur

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message