# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+[ "$SEARCH_INDEX" != true ] && return 1
[ "${PATH_INFO%\[search\]}" = "$PATH_INFO" ] && return 1
. "$_EXEC/cgilite/storage.sh"
while read date doc freq num total; do
P="$_DATA/pages$(UNSTRING "$doc")"
- d="$(stat -c %Y -- "$P/#index.flag")"
- [ "$d" -gt "$date" ] && continue
+ d="$(stat -c %Y -- "$P/#index.flag" 2>&-)"
+ [ "$d" -le "$date" ] 2>&- || continue
printf '%s %f\n' "$doc" "$freq"
done <"$I/$w"
done \
| awk '
- { cnt[$1]++; weight[$1] = weight[$1] ? weight[$1] * $2 : $2; }
+ { cnt[$1]++; weight[$1] = weight[$1] ? weight[$1] + $2 : $2; }
END { m = 0; for (d in cnt) m = ( m < cnt[d] ) ? cnt[d] : m;
for (d in cnt) if ( cnt[d] == m ) printf "%f %s\n", weight[d], d;
}