forcemerge.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [[indices-forcemerge]]
  2. == Force Merge
  3. The force merge API allows to force merging of one or more indices through an
  4. API. The merge relates to the number of segments a Lucene index holds within
  5. each shard. The force merge operation allows to reduce the number of segments by
  6. merging them.
  7. This call will block until the merge is complete. If the http connection is
  8. lost, the request will continue in the background, and any new requests will
  9. block until the previous force merge is complete.
  10. [source,js]
  11. --------------------------------------------------
  12. POST /twitter/_forcemerge
  13. --------------------------------------------------
  14. // CONSOLE
  15. // TEST[setup:twitter]
  16. [float]
  17. [[forcemerge-parameters]]
  18. === Request Parameters
  19. The force merge API accepts the following request parameters:
  20. [horizontal]
  21. `max_num_segments`:: The number of segments to merge to. To fully
  22. merge the index, set it to `1`. Defaults to simply checking if a
  23. merge needs to execute, and if so, executes it.
  24. `only_expunge_deletes`:: Should the merge process only expunge segments with
  25. deletes in it. In Lucene, a document is not deleted from a segment, just marked
  26. as deleted. During a merge process of segments, a new segment is created that
  27. does not have those deletes. This flag allows to only merge segments that have
  28. deletes. Defaults to `false`. Note that this won't override the
  29. `index.merge.policy.expunge_deletes_allowed` threshold.
  30. `flush`:: Should a flush be performed after the forced merge. Defaults to
  31. `true`.
  32. [float]
  33. [[forcemerge-multi-index]]
  34. === Multi Index
  35. The force merge API can be applied to more than one index with a single call, or
  36. even on `_all` the indices.
  37. [source,js]
  38. --------------------------------------------------
  39. POST /kimchy,elasticsearch/_forcemerge
  40. POST /_forcemerge
  41. --------------------------------------------------
  42. // CONSOLE
  43. // TEST[s/^/PUT kimchy\nPUT elasticsearch\n/]