Index: openacs-4/packages/search/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/search.tcl,v diff -u -r1.37.2.9 -r1.37.2.10 --- openacs-4/packages/search/www/search.tcl 27 Nov 2014 09:23:24 -0000 1.37.2.9 +++ openacs-4/packages/search/www/search.tcl 27 Nov 2014 09:45:31 -0000 1.37.2.10 @@ -133,10 +133,11 @@ # permissions into account) # set count [llength $result(ids)] -if { $offset >= $count } { set offset [expr {($count / $limit) * $limit}] } +if { $offset >= $result(count) } { set offset [expr {($result(count) / $limit) * $limit}] } set low [expr {$offset + 1}] set high [expr {$offset + $limit}] -if { $high > $count } { set high $count } +if { $high > $result(count) } { set high $result(count) } + if { $info(automatic_and_queries_p) && "and" in $q } { set and_queries_notice_p 1 } else { @@ -147,21 +148,15 @@ append url_advanced_search "advanced-search?q=$urlencoded_query" if { $num > 0 } { append url_advanced_search "&num=$num" } - set query $q set nquery [llength [split $q]] set stopwords $result(stopwords) set nstopwords [llength $result(stopwords)] template::multirow create searchresult title_summary txt_summary url_one object_id -for { set __i 0 } { $__i < $high - $low + 1 } { incr __i } { +foreach object_id $result(ids) { if {[catch { - set object_id [lindex $result(ids) $__i] - if {$object_id eq ""} { - ns_log warning "Search object_id is empty, this should never happen query was '$q'" - continue - } set object_type [acs_object_type $object_id] if {[callback::impl_exists -impl $object_type -callback search::datasource]} { array set datasource [lindex [callback -impl $object_type search::datasource -object_id $object_id] 0]