[Xapian-discuss] copy xapian.Document?

Richard Boulton richard at lemurconsulting.com
Fri Jul 27 14:21:26 BST 2007


James Aylett wrote:
> On Fri, Jul 27, 2007 at 09:06:00AM +0100, Richard Boulton wrote:
> 
>> The problem is that the Xapian::Document object lazily reads various
>> aspects of the Document from the database.
> 
> Do we need a method that causes all data to be read in?

I was wondering about that, but, since the method I outlined will work 
for now, and we'll have read-locks later, I'm not sure there's much need.

 > Actually, we
> could run it automatically if we try to add_document a document that
> already has a different database behind it, but it might be useful in
> other situations.

At the time a document from one database is added to another, all the 
details will be read in anyway, so there wouldn't be any need to 
explicitly call such a method there.  The value is from calling the 
method shortly after the document was read from the original database, 
which can't be done automatically because we don't know what's going to 
be done with it.

-- 
Richard



More information about the Xapian-discuss mailing list