From e3b48cfc1a043644495b1f20811b2505ea308257 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 6 Mar 2024 00:48:19 +0100 Subject: [PATCH] improved logging, less json rubbish --- index.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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), -- 2.39.2