[Xapian-discuss] xapian query group result by domain?

Olly Betts olly at survex.com
Mon Jan 15 23:51:06 GMT 2007


On Mon, Jan 15, 2007 at 09:59:20AM +0100, Felix Antonius Wilhelm Ostmann wrote:
> Olly Betts schrieb:
> >Put the domain name in a value and use
> >Xapian::Enquire::set_collapse_key() to collapse matches with the same
> >domain:
>
> i found out that this is very slow :( i need this feature too, but my 
> way is over the match_decider

You're effectively reimplemented the collapsing feature then.  If you
can do collapsing faster using a MatchDecider subclass then the
implementation of collapsing is suboptimal and should be fixed!  Or
just replaced with a standard subclass of MatchDecider which we ship
with the library.

I can believe the current implementation of collapsing could be improved
- for example, it sometimes has to do a linear scan of the candidate set
and then rebuild it as a heap, which I've never been totally happy about.

> the only problem: i use Perlbindings and never create an XS-Modul :(

If you're on Linux, run an example with slow collapsing under oprofile
with the callgraph enabled (call opcontrol with --callgraph=8 or
suitable stack depth, and opreport with --callgraph).  Then send the
report output (if it's huge, feel free to send it to me rather than
bombarding the list) and I'll see if there are any obvious hot spots
which could easily be eliminated.

Cheers,
    Olly



More information about the Xapian-discuss mailing list