[Xapian-discuss] questions about valuerangeprocessor and RefCntBase(edit and send again)
James Aylett
james-xapian at tartarus.org
Tue Apr 28 18:17:59 BST 2009
On Tue, Apr 28, 2009 at 09:46:55PM +0800, 白俊良 wrote:
> For example,i see that RefCntBase is a base class for objects which
> Xapian reference count,but i can not know the purpose that Xapian
> count reference,which is something i still want to know. Simply,why
> Xapian needs reference count?
Reference counting is a technique to approach memory management in
(principally) class libraries. I suggest you look up a good reference
on modern C++ practice to get a grip on the ideas behind it. The use
of reference counting techniques in Xapian is unrelated to its search
engine & information retrieval features.
> Another question is about ValueRangeProcessor. [...] i wonder that
> how Xapian works it out.I can't see a detailed description of the
> OP_VALUE_* query operators anywhere.
I think I stated earlier that we don't have any user-level
documentation of how OP_VALUE_* work. However most of the implementation is
in (for instance) matcher/valuerangepostlist.cc, which is only 168
lines long including comments. You care most about the next() and
check() methods, but if you want to know more you'll have to get stuck
into the code for post lists and how they get used.
> I have also read this:
> http://xapian.org/docs/matcherdesign.html
>
> I can not find any word about ValueRangeProcessor, or "ValueRangePostList".
> Then, how does the PostList Tree was design with RangeProcessor?
ValueRangeProcessor is only used by the QueryParser; it constructs the
relevant query using OP_VALUE_* operators to do what's needed. These
are implemented in the relevant Value*PostList class.
There's no separate documentation of how ValueRangePostList (for
instance) works; it's sufficiently small that you can read the source
to figure it out. The matcher design document explains how post lists
in general are used to build MSets.
J
--
James Aylett
talktorex.co.uk - xapian.org - uncertaintydivision.org
More information about the Xapian-discuss
mailing list