[Xapian-discuss] newb: Xapian Database setup

James Aylett james-xapian at tartarus.org
Sat Apr 21 17:56:10 BST 2007


On Sat, Apr 21, 2007 at 12:03:00PM -0400, Ram Peters wrote:

> what is argument "dbpath" in Xapian.WritableDatabase (I am uisng
> python binding)?
> 
> eg:
>    db = xapian.WritableDatabase(dbpath,
>        xapian.DB_CREATE_OR_OPEN)

It's the path to the database on disk. So you might do:

----------------------------------------------------------------------
db = xapian.WritableDatabase("/srv/db/xapian/mydb",
                             xapian.DB_CREATE_OR_OPEN)
----------------------------------------------------------------------

for instance.

> How does Xapian creates it's database?  Do I have to manually create
> them, any config file to specify username, password, ports and such?

Xapian will create everything you need (the database itself will be
held within a directory, at the ``dbpath'' you specify). Xapian
databases (like sqlite, but unlike most RDBMS such as MySQL, Oracle
and so forth) are not run using their own user database - whatever the
file permissions are on disk will apply to users trying to access the
database.

If you want to run Xapian using a remote protocol, you can, however
there is still no user access system. (You can effectively give
yourself one by using ssh tunnels, so you're using the operating
system user database again.)

Cheers,
James

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list