Why wouldn't numdocs serve?
Because the document id (which is the array index) would be in the range 0 ... maxDoc and not 0 ... numDocs, wouldn't it? Cheers, Carlos Best
Erick The motivation of this question is that I want to associate some info to > each document in the index, and in order to access this additional data in > O(1) I would like to do this through an array indexing. But the array size > shouldn't be a lot greater than the total number of documents. I see that > something similar is done in the example of section 6.1 of Lucene in > Action, > but for sorting purposes, which is not my case. > > Related to this: how can update my array of extra data when documents are > added/removed to/from the index? Is there any feedback mechanism by means > of > callbacks or event handlers? > > Thank you in advance. > Regards, > Carlos >