How to monitor OPTIMIZE index

Hi all, I ran OPTIMIZE INDEX on my rt-index(460 million records)
request processed quickly, then check SHOW INDEX STATUS:

the number of disk segments still shows 21
what am I doing wrong and how to monitor it correctly?

Check in searchd log (/var/log/manticore/searchd.log by default). If it got to merging it should read smth like:

[Tue Jun 14 05:28:11.501 2022] [247] rt: index t: optimized progressive chunk(s) 1 ( left 1 ) in 106ms 895us

The first number is how many chunks were merged (if you have 6 in total it will be 5). The second one - chunks left after merging.

Take into account:

  1. optimize doesn’t always merge down to a single chunk
  2. there’s auto optimize, which is ON by default
  3. the number of chunks to leave after merging is controlled by: