Changeset 1140


Ignore:
Timestamp:
Jan 20, 2008, 6:46:51 PM (14 years ago)
Author:
Earle Martin
Message:

Don't include redirect pages in search results. Closes #24.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r1138 r1140  
    88        Added experimental support for local IP blacklisting modules; see the
    99          display_node method in "perldoc OpenGuides" for details.
     10        Don't include redirect pages in search results. (#24)
    1011        Include map link URLs in RDF output. (#26)
    1112        Hide historic versions of nodes from search engines. (#207)
  • trunk/lib/OpenGuides/Search.pm

    r1034 r1140  
    504504    }
    505505
    506     # It'll be a real phrase (as opposed to a word) if it has a space in it.
    507     # In this case, dump out the nodes that don't match the search exactly.
    508     # I don't know why the phrase searching isn't working properly.  Fix later.
    509     if ( $phrase =~ /\s/ ) {
    510         my @tmp = keys %contents_res;
    511         foreach my $node ( @tmp ) {
    512             my $content = $wiki->retrieve_node( $node );
     506    my @tmp = keys %contents_res;
     507    foreach my $node ( @tmp ) {
     508        my $content = $wiki->retrieve_node( $node );
     509
     510        # Don't include redirects in search results.
     511        if ($content =~ /^#REDIRECT/) {
     512            delete $contents_res{$node};
     513            next;
     514        }
     515       
     516        # It'll be a real phrase (as opposed to a word) if it has a space in it.
     517        # In this case, dump out the nodes that don't match the search exactly.
     518        # I don't know why the phrase searching isn't working properly.  Fix later.
     519        if ( $phrase =~ /\s/ ) {
    513520            unless ( $content =~ /$phrase/i || $node =~ /$phrase/i ) {
    514521                delete $contents_res{$node};
    515             }
    516         }
     522            }
     523        }
     524
    517525    }
    518526
Note: See TracChangeset for help on using the changeset viewer.