hey, Thank you for excellent work, I have a little problem here. I made a search daemon, it holds a database obj for a long time, while the search request comes, it searches and return the results. For my own point of view, I think it holds a database obj is good for performance, it doesn't need to build database for every request. But I found if I have changed the database, like delete a document, the database didn't flush, only if I restart the search daemon. So my question is, the long life database obj, does it matter ? For every request build new database obj, is it right ? or is there a better way to handle this that I don't know ? Thank you. Matt
Excerpts from Matt Chen's message of Mon Jun 29 17:08:07 +1000 2009:> hey, > > Thank you for excellent work, I have a little problem here. > > I made a search daemon, it holds a database obj for a long time, > while the search request comes, it searches and return the results. > For my own point of view, I think it holds a database obj is good for > performance, it doesn't need to build database for every request. But > I found if I have changed the database, like delete a document, the > database didn't flush, only if I restart the search daemon. > > So my question is, the long life database obj, does it matter ? For > every request build new database obj, is it right ? or is there a > better way to handle this that I don't know ? > > Thank you. > > MattYou might want to read this thread: http://lists.xapian.org/pipermail/xapian-discuss/2009-June/006804.html rgh
On Mon, Jun 29, 2009 at 5:43 PM, Matt Chen<ceator at gmail.com> wrote:>> You might want to read this thread: >> >> ? ?http://lists.xapian.org/pipermail/xapian-discuss/2009-June/006804.html >> >> rgh >> >> _______________________________________________ >> Xapian-discuss mailing list >> Xapian-discuss at lists.xapian.org >> http://lists.xapian.org/mailman/listinfo/xapian-discuss >> > > Thanks for replay. > > I have read that thread before, and I add flush() at the end of > database update, but it doesn't change the search results only if I > restart the search daemon, and the flush() return void, how could I > know if it was flushed ? > > Is there something I missing ? I'm using the python bindings, and I > flush database like this: > > self.database.flush() > > > Matt >I did the test several times, The api said it will be changed automatically after closed the database, but it didn't change anyway. I also add the flush() before the index process end, it didn't work. Shall I re-construct the database obj that search daemon hold every time ? any suggestion would be great. Thank you. Matt