common-options.asciidoc 1.9 KB

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