白俊良
2009-Apr-28 13:46 UTC
[Xapian-discuss] questions about valuerangeprocessor and RefCntBase(edit and send again)
Hi! Alls As Charlie said that my questions are hard to understand,i try to rephrase them. Once you have time, please give me a help. Indeed, I care more about how Xapian works.And I want to learn how search engine works and how to design or optimize a search engine. I realized that some basic concept/classes,such as RefCntBase, internal and Stats, are very important. But i can not make clear that why Xapian need them.In another word, i can not find out how Xapian work with them. 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 ? Another question is about ValueRangeProcessor. I have read this: http://xapian.org/docs/valueranges.html Xapian::DateValueRangeProcessor date_proc(2, true, 1930); qp.add_valuerangeprocessor(&date_proc); these was added in my code and it works perfectly. I input the query"20090416..20090419", and I use query.get_description() to get the description "Parsed query is: Xapian::Query(VALUE_RANGE 2 20090216 20090219)". Then, i wonder that how Xapian works it out.I can't see a detailed description of the OP_VALUE_* query operators anywhere. Does Xapian rebuilt my query into 20090416,20090417,20090418 20090419 and retrieval them separately ? Or,it find start '20090416' and end '20090219' in the Btree,then return all the documents between them? In another word, How does Xapian work while search value in Btree? And what is the difference between using value or not while search? Generally speaking,i want to now how "valuerangesearch" works. Whether it only search in field "Value" or not? 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? Regards, baijl _________________________________________________________________ Live Search??????????????? http://www.live.com/?scope=video
James Aylett
2009-Apr-28 17:17 UTC
[Xapian-discuss] questions about valuerangeprocessor and RefCntBase(edit and send again)
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