Per the Kibana 4 blog post:
...JSON input which allows you to specify additional aggregation parameters to send with your request. For example, maybe you want to pass
shard_size
in aterms
agg, or increase theprecision_threshold
in a cardinality agg.
Here is another concrete example of using a scripted field in this input: Visualize: JSON Input: how to use?