common-options.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. [[api-common-options]]
  2. = Common API Options
  3. [float]
  4. == Pretty Results
  5. When appending `?pretty=true` to any request made, the JSON returned
  6. will be pretty formatted (use it for debugging only!). Another option is
  7. to set `format=yaml` which will cause the result to be returned in the
  8. (sometimes) more readable yaml format.
  9. [float]
  10. == Human readable output
  11. Statistics are returned in a format suitable for humans
  12. (eg `"exists_time": "1h"` or `"size": "1kb"`) and for computers
  13. (eg `"exists_time_in_millis": 3600000`` or `"size_in_bytes": 1024`).
  14. The human readable values can be turned off by adding `?human=false`
  15. to the query string. This makes sense when the stats results are
  16. being consumed by a monitoring tool, rather than intended for human
  17. consumption. The default for the `human` flag is
  18. `false`. added[1.00.Beta,Previously defaulted to `true`]
  19. [float]
  20. == Parameters
  21. Rest parameters (when using HTTP, map to HTTP URL parameters) follow the
  22. convention of using underscore casing.
  23. [float]
  24. == Boolean Values
  25. All REST APIs parameters (both request parameters and JSON body) support
  26. providing boolean "false" as the values: `false`, `0`, `no` and `off`.
  27. All other values are considered "true". Note, this is not related to
  28. fields within a document indexed treated as boolean fields.
  29. [float]
  30. == Number Values
  31. All REST APIs support providing numbered parameters as `string` on top
  32. of supporting the native JSON number types.
  33. [float]
  34. == Result Casing
  35. All REST APIs accept the `case` parameter. When set to `camelCase`, all
  36. field names in the result will be returned in camel casing, otherwise,
  37. underscore casing will be used. Note, this does not apply to the source
  38. document indexed.
  39. [float]
  40. == JSONP
  41. All REST APIs accept a `callback` parameter resulting in a
  42. http://en.wikipedia.org/wiki/JSONP[JSONP] result.
  43. [float]
  44. == Request body in query string
  45. For libraries that don't accept a request body for non-POST requests,
  46. you can pass the request body as the `source` query string parameter
  47. instead.