: In my project I have a query that can possibly return several millions of : documents. : >From these documents I always want the unique values from a certain field. : For the sake of clarity we can take for example the "id" field.
what you are describing sounds similar to the general concept of "faceted searching" also frequently discussed on teh mailing lists under the question of "category counts" ... in your specific case however it seems you don't care about the "counts" just the "categories" (ie: the distinct set of values for a field across all matched documents) given those search terms, i'm guessing you'll find more then enough information on the basic approaches that can be taken to tackle a faceting problem with any varient of Lucene. -Hoss
