[Xapian-discuss] How to update DB concurrently?

oscaruser at programmer.net oscaruser at programmer.net
Fri May 19 20:19:26 BST 2006


Olly,

Super, this worked perfectly. I want to change the appearance of the search results by adding my own data. To make this work I want to generate an XML stream with just URLs as the output of omega.cgi. How can I do this?

Thanks


> ----- Original Message -----
> From: "Olly Betts" <olly at survex.com>
> To: oscaruser at programmer.net
> Subject: Re: [Xapian-discuss] How to update DB concurrently?
> Date: Fri, 19 May 2006 04:17:53 +0100
> 
> 
> On Thu, May 18, 2006 at 04:39:36PM -0800, oscaruser at programmer.net wrote:
> > <       for (int index = 0; index < 150; index++) {
> > <       std::ostringstream s;
> > <       s << "/svr/hda1/omega/data/mydb" << std::setfill('0') << 
> > std::setw(4) << index
> > <         << "/default";
> > <       //cout << s.str() << endl;
> > <       db.add_database(Xapian::Database(s.str()));
> > <       }
> 
> There's no context, so I can't see where you're patching that, but it
> looks plausible.
> 
> However, I don't think you want to search 150 databases at once like
> this.  The overhead from opening that many databases on every search is
> likely to be noticable, and searching one big database will be more
> efficient.
> 
> Instead use xapian-compact to merge them all together like so:
> 
> xapian-compact -F -m /svr/hda1/omega/data/mydb*/default /path/to/output/db
> 
> And then search the merged database '/path/to/output/db'.
> 
> You almost certainly want to use -m if you can - it merges in multiple
> passes which for 150 databases should be substantially quicker.  It's
> probably worth using -F too unless you want to update the merged
> database by opening it as a WritableDatabase.
> 
> Cheers,
>      Olly

>


-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/




More information about the Xapian-discuss mailing list