page number by chapter has incorrect index entries

The document discusses subnet mask three times, around page 2-2, page 2-8 and 4-7. In each case, the term “subnet mask” is marked to be included in the index. I wanted an index entry something like:
subnet mask: 2-2, 2-8, 4-7. Combine identical terms is checked, otherwise I’d get three lines in the index (subnet mask 2-2, subnet mask 2-8 and subnet mask 4-7). What I get is

subnet mask: 4-2, 7, 8

This is incorrect. A similar bug number 60616 (https://bugs.documentfoundation.org/show_bug.cgi?id=60616) was opened sometime back.

Yes, that is a bug, and its status is “NEW” (unfortunately, not fixed). So, what is your question?

I just generated a comment on bug 60616. The text of that comment follows:

It’s been ten years since this bug was first reported. It is still a problem.

There is an ugly work around, at least for the time being.

LO Writer treats word entries as different if they have a different number of spaces after the index word. Corn with no space after the last n is different from Corn with one space after the last n, is different from Corn with two spaces after the last n. When formatting the entries of an index, trailing spaces are apparently truncated but - only when it’s time to format the lines of the index.

Using this, a convention of adding one space after index entries in chapter one and, two spaces after index entries in chapter two - or, perhaps only using this technique for those instances where something to be indexed appears in multiple chapters.

It does make for an index that will appear to show the same word multiple times in an index if, that indexed work appears in multiple chapters but - that’s better than having an incorrect entry (pointing to the wrong page) in the index.