From: Paul Hänsch Date: Tue, 5 Mar 2024 23:48:19 +0000 (+0100) Subject: improved logging, less json rubbish X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=e3b48cfc1a043644495b1f20811b2505ea308257;p=rigidfind improved logging, less json rubbish --- diff --git a/index.cgi b/index.cgi index 07cb6e3..532a323 100755 --- a/index.cgi +++ b/index.cgi @@ -217,7 +217,7 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then words="$( for j in $(DB2 "$J" iterate @); do json_get "$(UNSTRING "$j")" match_phrase_prefix.content - done 2>/dev/null + done 2>/dev/null |tr \\n ' ' )" debug "Search words: $words" @@ -234,6 +234,8 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then )" results="${results% }" + times >&2 + cat <<-EOF Status: 200 OK X-elastic-product: Elasticsearch @@ -241,7 +243,6 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then { "took":0, "timed_out":false, - "_shards":{"total":1,"successful":1,"skipped":0,"failed":0}, "hits": { "total":{"value": $(DB2 "$results" count @) ,"relation":"eq"}, "max_score": $(json_get "arr:$results" '[0]._score' 2>/dev/null || printf 0),