As the title, is it possible to edit the page number format of auto-generated index?
What I want is make "consecutive page number".
For example:
Term ----- 2, 3, 4, 5 (This is how word auto-generate)
Term ----- 2-5 (This is what I want)
Most law-related books will have this kind of index, such as:

(also the same hundred-digit number is omitted)
Thanks for advance for any help!