3 [ "${PATH_INFO%\[search\]}" = "$PATH_INFO" ] && return 1
5 . "$_EXEC/cgilite/storage.sh"
8 words="$(GET q |tr '] \t\n\r!\"#'\''()*+,./:;<=>?\\^_`{|}~[-' ' ')"
11 [ ! -f "$I/$w" ] && continue
13 while read date doc freq num total; do
14 P="$_DATA/pages$(UNSTRING "$doc")"
15 d="$(stat -c %Y -- "$P/#page.md")"
16 [ "$d" -gt "$date" ] && continue
18 printf '%s %f\n' "$doc" "$freq"
22 { cnt[$1]++; weight[$1] = weight[$1] ? weight[$1] * $2 : $2; }
23 END { m = 0; for (d in cnt) m = ( m < cnt[d] ) ? cnt[d] : m;
24 for (d in cnt) if ( cnt[d] == m ) printf "%f %s\n", weight[d], d;
28 | while read freq doc; do
29 page="$(UNSTRING "$doc")"
30 acl_read "$page" || continue
31 printf '<li><a href="%s">%s</a></li>' "$(URL "$page")" "$(HTML "$page")"
35 <h1>$(_ "Search results:")</h1>
36 <ol class="searchresults">