Skip to main content.
home | support | download

Back to List Archive

Re: Grouping results

From: John Angel <angel_john(at)not-real.hotmail.com>
Date: Mon Dec 01 2003 - 21:48:27 GMT
That way there will be less than 10 results per page.

E.g. what if all 10 results on page are from the same site, there will be 
only 2 results displayed?


>From: Bill Moseley <moseley@hank.org>
>Reply-To: moseley@hank.org
>To: Multiple recipients of list <swish-e@sunsite.berkeley.edu>
>Subject: [SWISH-E] Re: Grouping results
>Date: Tue, 25 Nov 2003 13:28:52 -0800 (PST)
>
>On Tue, Nov 25, 2003 at 01:24:41PM -0800, Bill Moseley wrote:
> > On Sun, Nov 23, 2003 at 12:45:23PM -0800, John Angel wrote:
> > > Is it possible to group results by site like on Google (to display 
>only 2
> > > hits from the same site, not all of them)?
> >
> > Did I already respond to this?
> >
> > You would have to post-process;  Need to think about what to do if
> > showing a page of results at a time -- you might come up short.
> >
> > Fake code:
> >
> > my %seen;
> > while ( my $result = next_result() ) {
> >     my $uri = URI->new( $result->swishdocpath );
> >     next if $seen{ $uri->host }++ == 2;
>
>I assume you want something more like >= 2.
>
>
> >     show_result( $result );
> > }
> >
> > --
> > Bill Moseley
> > moseley@hank.org
> >
> >
>
>--
>Bill Moseley
>moseley@hank.org
>

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail
Received on Mon Dec 1 21:48:38 2003