X-Git-Url: https://git.plutz.net//?a=blobdiff_plain;f=index.cgi;h=532a323c5294957b8be47b7f647e3a6578ab4004;hb=e3b48cfc1a043644495b1f20811b2505ea308257;hp=d936d40c4b7128e699bc5331b6cac3473eb913ec;hpb=9bc47aeb3d7417638c896e4f79d5c9d4c4109719;p=rigidfind diff --git a/index.cgi b/index.cgi index d936d40..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,14 +234,15 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then )" results="${results% }" - debug <<-EOF + times >&2 + + cat <<-EOF Status: 200 OK X-elastic-product: Elasticsearch Content-Type: application/vnd.elasticsearch+json;compatible-with=8 { "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),