TermsEnum will give you the first, and the last if you loop through to the end. Generally pretty fast. Or skip through with seekCeil() - might be faster.
-- Ian. On Wed, Feb 20, 2013 at 11:31 PM, Vitaly Funstein <vfunst...@gmail.com> wrote: > I know that general questions about aggregate functions have been asked > here before a number of times, but I would like to figure out how to solve > at least one specific subset of this issue. Namely, given a specific > indexed field, how do I efficiently get the min/max value of the field in > the index? Maybe I'm being naive but this sounds like it should be a super > simple task conceptually, since under the hood the index is a sorted data > structure. Of course, the ultimate idea here is to be able to do this > efficiently for the most general case, i.e. to apply range discovery to > query results, and perhaps do this for string fields as well as numeric. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org