3 ms·
Based on the bug filed[1], "Return number of documents in the result counts as HTTP header or in JSON," the implication is that including the number of document
by jonaf 10y ago
Based on the bug filed[1], "Return number of documents in the result counts as HTTP header or in JSON," the implication is that including the number of documents in the result in the JSON would be an acceptable solution. If that's true, then they're OK with parsing the JSON.
Although, to be fair, the related issue[2] specifically asks for an HTTP header.
JSON parsing is generally pretty fast, but I can understand it being unnecessary overhead (although in general, there are other more significant opportunities for optimization).
If you've ever implemented a JSON stream reader/writer, then you've done partial JSON parsing. Check out the tool `jq`[2], which will parse partial JSON surprisingly well and fast (and this is just a utility).
[1] https://github.com/elastic/elasticsearch/issues/18312 https://github.com/elastic/elasticsearch/issues/18312
[2] https://github.com/elastic/elasticsearch/issues/16993 https://github.com/elastic/elasticsearch/issues/16993
[3] https://stedolan.github.io/jq/ https://stedolan.github.io/jq/