3 [ "${PATH_INFO%\[search\]}" = "$PATH_INFO" ] && return 1
5 . "$_EXEC/cgilite/storage.sh"
8 words="$( GET q | sed -E '
10 s;([] \t\n\r!\"#'\''()*+,./:;<=>?\\^_`{|}~[-]|%[1-9A-Fa-f]{2})+; ;g
14 [ ! -f "$I/$w" ] && continue
16 while read date doc freq num total; do
17 P="$_DATA/pages$(UNSTRING "$doc")"
18 d="$(stat -c %Y -- "$P/#index.flag")"
19 [ "$d" -gt "$date" ] && continue
21 printf '%s %f\n' "$doc" "$freq"
25 { cnt[$1]++; weight[$1] = weight[$1] ? weight[$1] * $2 : $2; }
26 END { m = 0; for (d in cnt) m = ( m < cnt[d] ) ? cnt[d] : m;
27 for (d in cnt) if ( cnt[d] == m ) printf "%f %s\n", weight[d], d;
31 | while read freq doc; do
32 page="$(UNSTRING "$doc")"
33 acl_read "$page" || continue
34 printf '<li><a href="%s">%s</a></li>' "$(URL "$page")" "$(HTML "$page")"
38 <h1>$(_ "Search results:")</h1>
39 <ol class="searchresults">