I have spent a lot of time performing searching lately and I have this strange behavior to report.
My build_sort_order_search and build_sort_order_search_cat are set as score.
This is either a logic error when grouping links by category in Search.pm or is somehow mixed up via query or query_sth
Example 1
http://www.supportmusicians.com/...ubstring=0&mh=10
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction
Bands & Musicians - Rock - Pop
- Big Noise in the Corner
- Tamara Pierce Band
- 3 Chords & The Truth
Lights & Sound
- MAEURA MUSIC WORKS
Music Venues
- The Rave
Page 2 lists...
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - World
- RGB World, Inc.
Item in red is duplicate from page 1 and doesn't belong here at all.
Also message says 12 matches. Should be 11 matches.
Example 2
http://www.supportmusicians.com/...and;substring=0;mh=5
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction THIS LINK *DOESNT* SHOW HERE AND IT SHOULD
Bands & Musicians - Rock - Pop THIS CATEGORY DOESNT BELONG HERE
- Big Noise in the Corner THIS LINK DOESNT BELONG HERE EITHER
Page 2 lists...
Bands & Musicians - Country CATEGORY IS OUT OF ORDER. IT IS ON PREV PAGE ALREADY
- Boogie Junction OH HERE IS THE MISSING LINK FROM PREV PAGE
Bands & Musicians - Rap - Hip Hop
- mcnatural
Bands & Musicians - Rock - Pop
- Tamara Pierce Band
- 3 Chords & The Truth
Example 3
The only change from Example 2 is mh=5 changed to mh=3
http://www.supportmusicians.com/...substring=0&mh=3
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Rock - Pop THIS CATEGORY AND LINK SHOULD BE ON LAST PAGE
- Big Noise in the Corner
Page 2 lists...
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction
Page 3 lists...
Bands & Musicians - Rap - Hip Hop
- mcnatural
Bands & Musicians - Rock - Pop CATEGORY IS IN CORRECT PLACE
- Tamara Pierce Band
- 3 Chords & The Truth
So you can see that the grouping or ordering of the Links and Categories is wrong.
I happen to have a fresh copy of the grouping code from Search.pm handy
my (@link_results_loop, $link_results, %link_output);
if ($link_count) {
my $results = $link_sth->fetchall_hashref;
$links->add_reviews($results);
@link_results_loop = map Links::SiteHTML::tags('link', $_) => @$results unless $CFG->{build_search_gb};
if ($CFG->{build_search_gb}) {
my @ids = map { $_->{ID} } @$results;
my $catlink = $DB->table('CatLinks','Category');
my %names = $catlink->select('LinkID', 'Full_Name', { LinkID => \@ids })->fetchall_list;
foreach my $link (@$results) {
push @{$link_output{$names{$link->{ID}}}}, Links::SiteHTML::tags('link', $link);
}
}
}
# Join the link results by category if we are grouping.
if ($CFG->{build_search_gb}) {
foreach my $cat (sort keys %link_output) {
$link_output{$cat}->[0]->{title_linked} = sub { Links::Build::build('title_linked', { name => $cat, complete => 1, home => 0 }) };
$link_output{$cat}->[0]->{title_loop} = Links::Build::build('title', $cat);
push @link_results_loop, @{$link_output{$cat}};
}
}
$link_results = sub {
my $links;
$CFG->{build_search_gb} or return join("", map { Links::SiteHTML::display('link', $_) } @link_results_loop);
foreach my $cat (sort keys %link_output) {
my $title = Links::Build::build('title_linked', { name => $cat, complete => 1, home => 0 });
$links .= "<p>$title" . join("", map { Links::SiteHTML::display('link', $_) } @{$link_output{$cat}});
}
return $links;
};
Please let me know if this is a bug or operator error.
This bug affects my search by zipcode plugin as well, but it is also apparent in Advanced search.
Thanks
Chris
RGB World, Inc. - Software & Web Development.
rgbworld.com
My build_sort_order_search and build_sort_order_search_cat are set as score.
This is either a logic error when grouping links by category in Search.pm or is somehow mixed up via query or query_sth
Example 1
http://www.supportmusicians.com/...ubstring=0&mh=10
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction
Bands & Musicians - Rock - Pop
- Big Noise in the Corner
- Tamara Pierce Band
- 3 Chords & The Truth
Lights & Sound
- MAEURA MUSIC WORKS
Music Venues
- The Rave
Page 2 lists...
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - World
- RGB World, Inc.
Item in red is duplicate from page 1 and doesn't belong here at all.
Also message says 12 matches. Should be 11 matches.
Example 2
http://www.supportmusicians.com/...and;substring=0;mh=5
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction THIS LINK *DOESNT* SHOW HERE AND IT SHOULD
Bands & Musicians - Rock - Pop THIS CATEGORY DOESNT BELONG HERE
- Big Noise in the Corner THIS LINK DOESNT BELONG HERE EITHER
Page 2 lists...
Bands & Musicians - Country CATEGORY IS OUT OF ORDER. IT IS ON PREV PAGE ALREADY
- Boogie Junction OH HERE IS THE MISSING LINK FROM PREV PAGE
Bands & Musicians - Rap - Hip Hop
- mcnatural
Bands & Musicians - Rock - Pop
- Tamara Pierce Band
- 3 Chords & The Truth
Example 3
The only change from Example 2 is mh=5 changed to mh=3
http://www.supportmusicians.com/...substring=0&mh=3
Page 1 lists
Bands & Musicians - Alternative
- Easy Chair
Bands & Musicians - Blues
- Jon Justice Band
Bands & Musicians - Rock - Pop THIS CATEGORY AND LINK SHOULD BE ON LAST PAGE
- Big Noise in the Corner
Page 2 lists...
Bands & Musicians - Country
- Bear Creek Band
- Twain Trax
- Boogie Junction
Page 3 lists...
Bands & Musicians - Rap - Hip Hop
- mcnatural
Bands & Musicians - Rock - Pop CATEGORY IS IN CORRECT PLACE
- Tamara Pierce Band
- 3 Chords & The Truth
So you can see that the grouping or ordering of the Links and Categories is wrong.
I happen to have a fresh copy of the grouping code from Search.pm handy
Code:
# And format the link results. my (@link_results_loop, $link_results, %link_output);
if ($link_count) {
my $results = $link_sth->fetchall_hashref;
$links->add_reviews($results);
@link_results_loop = map Links::SiteHTML::tags('link', $_) => @$results unless $CFG->{build_search_gb};
if ($CFG->{build_search_gb}) {
my @ids = map { $_->{ID} } @$results;
my $catlink = $DB->table('CatLinks','Category');
my %names = $catlink->select('LinkID', 'Full_Name', { LinkID => \@ids })->fetchall_list;
foreach my $link (@$results) {
push @{$link_output{$names{$link->{ID}}}}, Links::SiteHTML::tags('link', $link);
}
}
}
# Join the link results by category if we are grouping.
if ($CFG->{build_search_gb}) {
foreach my $cat (sort keys %link_output) {
$link_output{$cat}->[0]->{title_linked} = sub { Links::Build::build('title_linked', { name => $cat, complete => 1, home => 0 }) };
$link_output{$cat}->[0]->{title_loop} = Links::Build::build('title', $cat);
push @link_results_loop, @{$link_output{$cat}};
}
}
$link_results = sub {
my $links;
$CFG->{build_search_gb} or return join("", map { Links::SiteHTML::display('link', $_) } @link_results_loop);
foreach my $cat (sort keys %link_output) {
my $title = Links::Build::build('title_linked', { name => $cat, complete => 1, home => 0 });
$links .= "<p>$title" . join("", map { Links::SiteHTML::display('link', $_) } @{$link_output{$cat}});
}
return $links;
};
Please let me know if this is a bug or operator error.
This bug affects my search by zipcode plugin as well, but it is also apparent in Advanced search.
Thanks
Chris
RGB World, Inc. - Software & Web Development.
rgbworld.com