[Xapian-discuss] ruby xapian bindings and windows

Pietro Giorgianni giorgian at gmail.com
Wed Nov 19 09:16:07 GMT 2008


Hi,

I've compiled xapian 1.0.9 (core and buildings) on Windows Xp, using
Lemur's nmake files[1].

I'm trying to use acts_as_xapian [2] on RubyOnRails, but I'm facing a
problem with the rebuild index process.

in acts_as_xapian, to rebuild the index, a new
Xapian::WritableDatabase is created with a different path, then
flush() is invoked; lastly, the new path is renamed to the old one.

At this point, the operation fails on Windows, since the flush()
method doesn't close the involved files, and on Windows renaming or
deleting open files is forbidden.

I tried to take a look at the Xapian API Documentation, but it seems
to me that only the destructor of Xapian::WritableDatabase does close
the files.

Is this correct or I'm missing something?

I suppose that creating a new physical index rather than overwriting
the old one, is the right way to do stuff, so now I'm looking for a
way to make things work as painless as I can.

How can I make Xapian::WritableDatabase to release (close) the files
it is using? Can I do that via Ruby, or diving into the code is
needed?

thanks

pietro

[1] http://lemurconsulting.com/Products/Xapian/Overview.shtml
[2] http://github.com/frabcus/acts_as_xapian/tree/master



More information about the Xapian-discuss mailing list