From 73b38f54989824dee0a69a37379d1100c3753082 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 21 Jan 2006 00:45:21 +0000 Subject: [PATCH] added lineage search --- lib/WebGUI/Search.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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 ( )