diff --git a/lib/WebGUI/Search.pm b/lib/WebGUI/Search.pm index 0c0cd6d63..a15371e57 100644 --- a/lib/WebGUI/Search.pm +++ b/lib/WebGUI/Search.pm @@ -152,6 +152,8 @@ sub rawClause { A simple keyword search. +=head3 match + Should we match "any" or "all" of the keywords. =head3 keywords @@ -174,6 +176,36 @@ sub search { } +#------------------------------------------------------------------- + +=head2 searchLimitLineage ( lineage, match, keywords ) + +A simple keyword search limiting the search to a particular lineage. + +=head3 lineage + +The lineage to limit the search to. + +=head3 match + +Should we match "any" or "all" of the keywords. + +=head3 keywords + +An array of the key words or phrases to match against. + +=cut + +sub searchLimitLineage { + my $self = shift; + my $lineage = shift; + $self->search(@_); + $self->{_query} = "lineage like ? and (".$self->{_query}.")"; + my @params = @{$self->{_params}}; + unshift(@params, $lineage.'%'); + $self->{_params} = \@params; +} + #------------------------------------------------------------------- =head2 session ( )