flush.asciidoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [[indices-flush]]
  2. == Flush
  3. The flush API allows to flush one or more indices through an API. The
  4. flush process of an index basically frees memory from the index by
  5. flushing data to the index storage and clearing the internal
  6. <<index-modules-translog,transaction log>>. By
  7. default, Elasticsearch uses memory heuristics in order to automatically
  8. trigger flush operations as required in order to clear memory.
  9. [source,js]
  10. --------------------------------------------------
  11. $ curl -XPOST 'http://localhost:9200/twitter/_flush'
  12. --------------------------------------------------
  13. [float]
  14. [[flush-parameters]]
  15. === Request Parameters
  16. The flush API accepts the following request parameters:
  17. [horizontal]
  18. `wait_if_ongoing`:: If set to `true` the flush operation will block until the
  19. flush can be executed if another flush operation is already executing.
  20. The default is `false` and will cause an exception to be thrown on
  21. the shard level if another flush operation is already running.
  22. `full`:: If set to `true` a new index writer is created and settings that have
  23. been changed related to the index writer will be refreshed. Note: if a full flush
  24. is required for a setting to take effect this will be part of the settings update
  25. process and it not required to be executed by the user.
  26. (This setting can be considered as internal)
  27. `force`:: Whether a flush should be forced even if it is not necessarily needed ie.
  28. if no changes will be committed to the index. This is useful if transaction log IDs
  29. should be incremented even if no uncommitted changes are present.
  30. (This setting can be considered as internal)
  31. [float]
  32. [[flush-multi-index]]
  33. === Multi Index
  34. The flush API can be applied to more than one index with a single call,
  35. or even on `_all` the indices.
  36. [source,js]
  37. --------------------------------------------------
  38. $ curl -XPOST 'http://localhost:9200/kimchy,elasticsearch/_flush'
  39. $ curl -XPOST 'http://localhost:9200/_flush'
  40. --------------------------------------------------