lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Optimize and internal document order
Date Fri, 31 Aug 2007 16:59:07 GMT
Andrzej Bialecki wrote:
> If so, then in the 
> trunk/ version of Lucene, is there any way to figure out (predictably) 
> how internal document numbers are reassigned after calling optimize() ?

If each document has an indexed id field in both indexes, then you could 
simply use a FieldCache of that id field in each index to determine the 
mapping.  You'd have to re-create the map from scratch each time either 
index changed, but it shouldn't be too slow.  FieldCache creation just 
iterates through terms and then through the TermDocs of each of those 
terms, sequentially accessing the tis and frq files.  Then creating the 
mapping you need would require something like a few HashMap accesses per 
document.  Would that be too slow?

Alternately, you could wait for LUCENE-847, and implement a 
FilterMergePolicy that tracks document id changes.


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

View raw message