[Xapian-discuss] mistake in http://xapian.org/docs/valueranges.html

Allen daineng at gmail.com
Wed Oct 8 08:54:51 BST 2008


I think there is a mistake in http://xapian.org/docs/valueranges.html,
SECTION "Custom subclasses", source followed:

struct AuthorValueRangeProcessor : public Xapian::ValueRangeProcessor {
    AuthorValueRangeProcessor() {}
    ~AuthorValueRangeProcessor() {}

    Xapian::valueno operator()(std::string &begin, std::string &end) {
        if (begin.substr(0, 7) != "author:")
            return Xapian::BAD_VALUENO;
        begin.erase(0, 7);
        begin = Xapian::Unicode::tolower(term);
        end = Xapian::Unicode::tolower(term);
        return 4;
    }
};

term is the parameter of tolower in it's definition:

begin = Xapian::Unicode::tolower(term);
end = Xapian::Unicode::tolower(term);

shoule be :

begin = Xapian::Unicode::tolower(begin);
end = Xapian::Unicode::tolower(end);


More information about the Xapian-discuss mailing list