Jean-Francois Dockes
2010-Dec-16 10:47 UTC
[Xapian-discuss] Enquire::get_mset() "first" and MatchDecider
Hello, This is a somewhat idle question about Enquire::get_mset(), possibly based on wrong assumptions on how Xapian works, but I would be grateful if someone satisfied my curiosity. Xapian::MSet Xapian::Enquire::get_mset(Xapian::doccount first, Xapian::doccount maxitems, const Xapian::RSet * omrset = 0, const Xapian::MatchDecider * mdecider = 0) const I had assumed that the "first" parameter referred to an index in the result set as filtered by the MatchDecider, but then it seems strange that you can change the latter from call to call. Under what conditions can you change the mdecider used and keep a consistent (result set index)-to-(document id) correspondance for a given mdecider ? I'm guessing you have to restart from first==0 ? Shouldn't mdecider only be changeable as part of some kind of "rewind" operation then? Cheers, J.F. Dockes
Richard Boulton
2010-Dec-16 11:15 UTC
[Xapian-discuss] Enquire::get_mset() "first" and MatchDecider
On 16 December 2010 10:47, Jean-Francois Dockes <jf at dockes.org> wrote:> This is a somewhat idle question about Enquire::get_mset(), possibly based > on wrong assumptions on how Xapian works, but I would be grateful if > someone satisfied my curiosity.I suspect there is a wrong assumption here: what you may be missing is that each call to get_mset() performs the search from scratch: the Enquire object doesn't cache results.> I had assumed that the "first" parameter referred to an index in the result > set as filtered by the MatchDecider, but then it seems strange that you can > change the latter from call to call.The first parameter does indeed refer to an index in the filtered result set.> Under what conditions can you change the mdecider used and keep a > consistent (result set index)-to-(document id) correspondance for a given > mdecider ? I'm guessing you have to restart from first==0 ? Shouldn't > mdecider only be changeable as part of some kind of "rewind" operation > then?If you change the mdecider used, the document ID at any particular index may indeed change: I'm not sure why this would be a problem though, or what you mean by a "rewind" operation. -- Richard