From: Paul Hänsch Date: Fri, 22 Sep 2023 19:27:48 +0000 (+0200) Subject: much faster indexer (but will require maintenance via cron) X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=4e89a8d6ab962a2582f78fbf47b1f49c735662cd;p=shellwiki much faster indexer (but will require maintenance via cron) --- diff --git a/parsers/40_indexer.sh b/parsers/40_indexer.sh index 08060f1..7190b0b 100755 --- a/parsers/40_indexer.sh +++ b/parsers/40_indexer.sh @@ -49,20 +49,8 @@ done \ ' \ | while read -r num total freq word; do [ "$word" ] || continue - F="$I/$word" - L="$(STRING "$DOC")" - - if LOCK "$F"; then - touch "$F" - { while read d l f n t; do - [ "$l" = "$L" ] \ - || printf "%i %s %f %i %i\n" \ - "$d" "$l" "$f" "$n" "$t" - done <"$F" - printf "%i %s %f %i %i\n" \ - "$_DATE" "$L" "$freq" "$num" "$total" - } >"$F.$$" - mv -- "$F.$$" "$F" - RELEASE "$F" - fi + printf "%i %s %f %i %i\n" \ + "$_DATE" "$(STRING "$DOC")" \ + "$freq" "$num" "$total" \ + >>"$I/$word" done