]> git.plutz.net Git - rigidfind/commitdiff
bugfix: do not kill stderr ;-)
authorPaul Hänsch <paul@plutz.net>
Tue, 5 Mar 2024 16:09:09 +0000 (17:09 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 5 Mar 2024 16:09:09 +0000 (17:09 +0100)
index.cgi

index 50fb338aa1c0e7413664c3c44fd4e0b3090fe770..d936d40c4b7128e699bc5331b6cac3473eb913ec 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -234,7 +234,7 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then
   )"
   results="${results%  }"
 
-  cat <<-EOF
+  debug <<-EOF
        Status: 200 OK\r
        X-elastic-product: Elasticsearch\r
        Content-Type: application/vnd.elasticsearch+json;compatible-with=8\r
@@ -244,7 +244,7 @@ elif [ "$REQUEST_METHOD" = "POST" ]; then
          "_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>&- || printf 0),
+           "max_score": $(json_get "arr:$results" '[0]._score' 2>/dev/null || printf 0),
            "hits": $(json_dump "arr:$results")
          }
        }