Index: openacs-4/packages/acs-api-browser/www/proc-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/proc-search.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-api-browser/www/proc-search.tcl 14 Jun 2015 00:04:21 -0000 1.14 +++ openacs-4/packages/acs-api-browser/www/proc-search.tcl 24 Jun 2015 19:10:41 -0000 1.15 @@ -14,9 +14,9 @@ @cvs-id $Id$ } { {name_weight:optional 0} - {doc_weight:optional 0} - {param_weight:optional 0} - {source_weight:optional 0} + {doc_weight:integer,optional 0} + {param_weight:integer,optional 0} + {source_weight:integer,optional 0} {search_type:optional 0} {show_deprecated_p:boolean 0} {show_private_p:boolean 0} @@ -46,7 +46,7 @@ ########################### # No weighting use default: -if { ($name_weight == 0) && ($doc_weight == 0) && ($param_weight == 0) && ($source_weight ==0) } { +if { ($name_weight == 0) && ($doc_weight == 0) && ($param_weight == 0) && ($source_weight == 0) } { set name_weight 1 } @@ -72,7 +72,7 @@ ############### ## Name Search: ############### - if {$name_weight} { + if {$name_weight != 0 && [string is integer -strict $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 @@ -97,7 +97,7 @@ ############## ## Doc Search: ############## - if {$doc_weight} { + if {$doc_weight > 0} { set doc_string [lindex $doc_elements(main) 0] if {[info exists doc_elements(param)]} { @@ -115,7 +115,7 @@ ################# ## Source Search: ################# - if {$source_weight} { + if {$source_weight != 0} { if {![catch {set source [info body $proc]}]} { incr score [expr {$source_weight * [::apidoc::ad_keywords_score $query_string $source]}] }