docid is a signed int32 so it is not so big, but really docid seams not a primary key unmodifiable but a temporary id for the view related to a specific search.
So repository can contains more than 2^31 documents. My deduction is correct ? is there a maximum size for lucene index?