Re: Letor: returning MSet after re-ranking

Olly Betts <[email protected]>
Newsgroups gmane.comp.search.xapian.devel
Message-ID <[email protected]>
On Sun, Jul 31, 2016 at 03:49:05AM +0530, Ayush Tomar wrote:
> What would you suggest should be the way out to access MSet internals from
> -letor, if we can't add things to -core's public API?

I wouldn't say we can't add things to the core API, but it's much better
if additions are clean, somewhat minimal (adding a lot of new methods
and/or classes makes the API harder to learn and to work with, though
being overly minimal has its downsides too so there can be a balance to
strike on this), consistent with the existing API, and if possible have
more than a single use.

Would a method which swapped two elements of an MSet provide what you
need?  That would provide a more generic way to adjust the ranking of
an MSet which for example could be used to implement a diversification
feature or something like SQL "GROUP BY".

For example:

void MSet::exchange(Xapian::doccount a, Xapian::doccount b);

Perhaps with an overloaded form which takes two MSetIterator objects for
convenience.

Cheers,
    Olly
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.