)"
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
"_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")
}
}