]> git.plutz.net Git - shellwiki/blobdiff - handlers/40_search.sh
use db23 from cgilite
[shellwiki] / handlers / 40_search.sh
index a4d91a82a8fa5e0f3861bf48f93ce6ac6fb1060b..1e3301944299d1288b690947953cdba56164abd7 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright 2023 Paul Hänsch
+# Copyright 2023, 2024 Paul Hänsch
 # 
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -18,7 +18,7 @@
 [ "${PATH_INFO%\[search\]}" = "$PATH_INFO" ] && return 1
 
 . "$_EXEC/cgilite/storage.sh"
-. "$_EXEC/db23.sh"
+. "$_EXEC/cgilite/db23.sh"
 
 I="$_DATA/index"
 words="$( GET q | awk '
@@ -69,7 +69,7 @@ for w in ${words}; do
   while read date doc freq num total; do
     P="$_DATA/pages$(UNSTRING "$doc")"
     d="$(stat -c %Y -- "$P/#index.flag" 2>&-)"
-    [ "$d" -le "$date" ] 2>&- || continue
+    [ "$d" -le "$date" -a -f "$P/#page.md" ] 2>&- || continue
 
     printf '%s %f\n' "$doc" "$freq"
   done <"$I/$w"