Index: openacs.org-dev/packages/acs-api-browser/www/proc-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/acs-api-browser/www/proc-search.tcl,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/acs-api-browser/www/proc-search.tcl 9 Jul 2002 17:34:56 -0000 1.1.1.1 +++ openacs.org-dev/packages/acs-api-browser/www/proc-search.tcl 8 Oct 2002 15:46:41 -0000 1.1.1.2 @@ -10,7 +10,7 @@ Note: api documentation information taken from nsv array @author Todd Nightingale (tnight@arsdigita.com) - @date Jul 14, 2000 + @creation-date Jul 14, 2000 @cvs-id $Id$ } { {name_weight:optional 0} @@ -21,7 +21,7 @@ query_string } -properties { title:onevalue - context_bar:onevalue + context:onevalue name_weight:onevalue doc_weight:onevalue param_weight:onevalue @@ -39,7 +39,7 @@ ## Optimizes quick search if {$quick_view && [nsv_exists api_proc_doc $query_string]} { ad_returnredirect [api_proc_url $query_string] - return + ad_script_abort } ########################### @@ -61,9 +61,14 @@ ## Name Search: ############### if {$name_weight} { + # JCD: this was a little perverse since exact matches were + # actually worth less than matches in the name (if there were + # 2 or more, which happens with namespaces) so I doubled the + # value of an exact match. + ##Exact match: if {[string tolower $query_string] == [string tolower $proc]} { - incr score $name_weight + incr score [expr $name_weight * 2] } incr score [expr $name_weight * [ad_keywords_score $query_string $proc]] } @@ -106,19 +111,24 @@ ##### ## Place Needed info in matches if {$score} { - lappend matches [list $proc $score $doc_elements(positionals)] + if {$doc_elements(varargs_p)} { + set args "$doc_elements(positionals) \[ args... \]" + } else { + set args $doc_elements(positionals) + } + lappend matches [list $proc $score $args] } } set matches [lsort -command ad_sort_by_score_proc $matches] if {$quick_view && ![empty_string_p $matches]} { ad_returnredirect [api_proc_url [lindex [lindex $matches 0] 0]] - return + ad_script_abort } set title "Procedure Search for: \"$query_string\"" -set context_bar [ad_context_bar "Search: $query_string"] +set context [list "Search: $query_string"] multirow create results score proc args url