[Xapian-devel] Re: [Xapian-commits] 9092: trunk/xapian-core/
trunk/xapian-core/api/
trunk/xapian-core/common/ trunk/xapian-core/include/xapian/
Richard Boulton
richard at lemurconsulting.com
Sat Jun 30 18:27:01 BST 2007
olly wrote:
> SVN root: svn://svn.xapian.org/xapian
> Changes by: olly
> Revision: 9092
> Date: 2007-06-30 15:16:16 +0100 (Sat, 30 Jun 2007)
>
> Log message (2 lines):
> api/omdocument.cc,common/document.h,include/xapian/document.h:
> Add Xapian::Document::get_docid() method.
I was thinking that it would probably be useful to have a
Xapian::Document::get_database_name() method, to allow the database that
a document came from (in a multi-database situation) to be obtained.
For a Flint database, this would return the path that was used to open
the database. For a remote (TCP) database, it would return a string
indicating the host and port that the database is at (probably in a
pseudo URL form something like "remotetcp://host:port/"), and something
similar for a remote progsrv database. Not sure what an inmemory one
would return...
Alternatively, databases could have a new "set_name()" method which sets
the name to return (possibly with something like the above as the
default) to avoid having to do long string compares to work out which
database a document came from.
This would also be useful for the ErrorHandler mechanism (for reporting
which database in a remote situation a failure occurred in).
--
Richard
More information about the Xapian-devel
mailing list