[Xapian-discuss] Making SORTAFTER useful in omega?

Olly Betts olly at survex.com
Fri Oct 10 05:18:38 BST 2008

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.

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

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.


More information about the Xapian-discuss mailing list