[Xapian-discuss] Making SORTAFTER useful in omega?
Jim
jim at fayettedigital.com
Sat Sep 27 13:22:47 BST 2008
Arjen van der Meijden wrote:
> I've patched xapian-core to contain another Sorter, which takes the
> calculated weight, then rounds it (actually just multiplies it and
> casts it to int) and uses it as part the first part of a sort key. The
> second part is simply the value's content for a specific document
> which you'd would already be used with the
> sort_by_relevance_then_value-call.
>
> To give the sorter access to the weight, I added it to the
> operator()-call.
>
> You can enable my RoundedWeightSorter from within omega using the
> 'SORTFACTOR='-parameter on top of the normal SORTAFTER= and SORT=
>
> From my first looks and limited tests a reasonable value seems to be
> to round the weight to 2 decimals after the dot (sortfactor of 100).
> The time to do the search seems to be similar to a normal value based
> sorted search.
>
> The patches are based on Xapian/Omega 1.0.8 and obviously I'd like to
> hear about all flaws in my approach.
>
> Best regards,
>
> Arjen
Arjen, thanks, I like that. I had a client want something like that
last year. I'll see if he wants me to modify the exisisting search to
include it. Probably not since he's a bit tight on budgets right now.
He wanted a way to factor date into the sort order. If I understand
what you have done, results with relevancy in the 90-100 bucket could
be grouped and then sorted on something like date. Same for 80-89,
etc. Did I understand that correctly?
Thanks,
Jim.
More information about the Xapian-discuss
mailing list