Dear, guys: I am a beginner of Xapian, when reading the documents, I encountered follow questions. (1) I see the Xapian::Document has a method void add_value (Xapian::valueno valueno, const std::string &value) What's the purpose of this method? Document will related to the terms, but what's the purpose of this? (2) add_posting method will add term to a documents. void add_posting (const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1) I noticed that Xapian::TermGenerator has follow method void index_text (const Xapian::Utf8Iterator &itor, Xapian::termcount weight=1, const std::string &prefix="") What's the differences and relationship between these two functions? Thanks a lot! Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20080916/fc686738/attachment-0001.html>
Richard Boulton
2008-Sep-16 09:56 UTC
[Xapian-devel] Some Questions From the beginner of Xapian
liminghit wrote:> (1) I see the Xapian::Document has a method > > * void add_value (Xapian::valueno valueno, const std::string &value)* > > What's the purpose of this method? Document will related to the > terms, but what's the purpose of this?Values are extra pieces of information which can be used during the search to modify the search in some way. For example, they can be used to add an extra weight to some documents, or to sort the results in a different order, or to collapse results from a single website.> (2) add_posting method will add term to a documents. > > * void add_posting (const std::string &tname, Xapian::termpos tpos, > Xapian::termcount wdfinc=1)* > > I noticed that > > Xapian::TermGenerator has follow method > > * void index_text (const Xapian::Utf8Iterator &itor, Xapian::termcount > weight=1, const std::string &prefix="")* > > What's the differences and relationship between these two functions?I've just added a FAQ which should answer this. http://trac.xapian.org/wiki/FAQ/TermGenerator -- Richard