[Xapian-tickets] [Xapian] #295: Add support for multi and remote databases with PostingSources (was: Add support for multi databases with PostingSources)
Xapian
nobody at xapian.org
Wed Oct 1 22:26:58 BST 2008
#295: Add support for multi and remote databases with PostingSources
-------------------------+--------------------------------------------------
Reporter: richard | Owner: richard
Type: enhancement | Status: assigned
Priority: normal | Milestone: 1.1.0
Component: Matcher | Version: SVN HEAD
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: All | Blocking:
-------------------------+--------------------------------------------------
Changes (by richard):
* status: new => assigned
Comment:
Will shortly be attaching a patch which adds support for this for remote
databases, too.
With this patch, PostingSource requires a clone() method to be implemented
in all cases, and also requires a name(), serialise() and unserialise()
method to be implemented for remote matches. The PostingSource subclass
needs to be registered with the remote server - ValueWeightPostingSource
is registered automatically.
I've also changed the Query constructor which takes a PostingSource to
take one by reference now, and clone() it. The Query::Internal object
then deletes the newly allocated source in its destructor - this is needed
to make the code in RemoteServer which unserialises the query able to
supply a newly created source to Query::Internal without having to write
lots of code to handle the case of such an owned pointer specifically.
It's also less likely to lead to memory leaks in general, I think, and
should avoid crashes due to PostingSources created external to Xapian
going out of scope before get_mset() is called. (This has been a
particular problem that I've noticed with the Python bindings - easy
enough to work around, but a bit startling the first time it happens.)
--
Ticket URL: <http://trac.xapian.org/ticket/295#comment:1>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list