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"
)"
results="${results% }"
+ times >&2
+
cat <<-EOF
Status: 200 OK\r
X-elastic-product: Elasticsearch\r
\r
{ "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),