[Xapian-discuss] Making SORTAFTER useful in omega?

Arjen van der Meijden acmmailing at tweakers.net
Fri Oct 10 08:53:34 BST 2008


On 10-10-2008 6:18, Olly Betts wrote:
> On Fri, Oct 03, 2008 at 03:43:42PM +0200, Arjen van der Meijden wrote:
>> For a product search we'd like to increase the weight based on what kind 
>> of product it is. I.e. if someone is searching for 'asus eee pc' he 
>> probably isn't expecting to see a asus eee pc mouse as the first result.
>> That was a problem I also was intending to fix with a sorter, but I 
>> didn't know about your postingsource when I wrote that. The 
>> PostingSource seems to be a better solution for that, depending on how 
>> easy it is to use.
> 
> If you have a way of deciding which results want the boost, then yes.
> You'll need to be able to decide that for any solution to work though.

We do know that indeed. It depends on the product's category.

> It's not much harder to use than the Sorter.  But both suffer from
> requiring source code changes for use in Omega, which is a problem for
> all user subclasses.
> 
> I'm not sure what the best answer is - at one point it was suggested to
> rewrite Omega in a scripting language (e.g. Python) but that's quite a
> job.  You could also turn Omega into an API which could be wrapped with
> SWIG, but that's also a fair amount of work.  Both of these approaches
> also mean that you incur the overhead of a trip from C++ to Python and
> back for each operation, which can add up when you do it for a million
> documents.
> 
> Allowing plugins to Omega would mean you'd not need to recompile the
> whole of Omega, just the plugin, but I'm not sure that really makes it
> significantly less hassle.

Perhaps you could allow to somehow script/configure extra behaviour, a 
bit like all those java-solutions which can load extra 
modules/classes/etc based on some (xml)configuration file.

Then you could configure that you'd want some age based posting source 
to be active as soon as a flag F is supplied which is set to give items 
from last week extra weight W1, items from at most half a year ago 
weight W2, etc. Another useful posting source would be one that can 
decide to use some value or based on the existence of some term/boolean 
to give extra weight.

Best regards,

Arjen




More information about the Xapian-discuss mailing list