From 4e89a8d6ab962a2582f78fbf47b1f49c735662cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 22 Sep 2023 21:27:48 +0200 Subject: [PATCH] much faster indexer (but will require maintenance via cron) --- parsers/40_indexer.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) 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 -- 2.39.2