Bug 92851 - Editing: Index entries affect alphabetical index with concordance file's ability to find other search terms
Summary: Editing: Index entries affect alphabetical index with concordance file's abi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: Other All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Concordance-File
  Show dependency treegraph
Reported: 2015-07-21 06:12 UTC by Winfried Donkers
Modified: 2020-12-14 15:31 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:

concordance document (14 bytes, text/plain)
2015-07-21 06:12 UTC, Winfried Donkers
writer document with index (10.68 KB, application/vnd.oasis.opendocument.text)
2015-07-21 06:12 UTC, Winfried Donkers
second concordance file that partially disables indexing (110 bytes, text/plain)
2015-07-21 06:19 UTC, Winfried Donkers
Second Writer document (11.31 KB, application/vnd.oasis.opendocument.text)
2015-07-21 06:21 UTC, Winfried Donkers

Note You need to log in before you can comment on or make changes to this bug.
Description Winfried Donkers 2015-07-21 06:12:01 UTC
Created attachment 117354 [details]
concordance document

Steps to reproduce
1. Create a new Writer Document
2. Enter the following text:
     Alice Bob Charlie
3. Use a concordance file to create an index (see attachment)
4. Open search bar (Ctrl-F), enter:
     Alice Bob
   and start search
5. It will not find the text because of the (invisible) index mark before Bob.

Note: manually adding words for the index (see attachment) does not disable searching; 'Bob Charlie' is found when entered in the search field.

Problem occurs in versions later than 4.1.6 (4.2, 4.4.4, master) adn probably in earlier version too, but can't verifiy that.

O/S Linux as well as Windows
Comment 1 Winfried Donkers 2015-07-21 06:12:27 UTC
Created attachment 117355 [details]
writer document with index
Comment 2 Winfried Donkers 2015-07-21 06:19:42 UTC
Created attachment 117356 [details]
second concordance file that partially disables indexing

As a result, the order in which search terms are entered in the concordance file determines whether that terms gets into the index:

LibreOffice Writer
indexing bug

As 'writer' is searched first and found (and index mark gets placed), 'LibreOffice Writer' is no longer found and will not get into the index.
'indexing bug' is searched and found, but as the index mark is not within the next search term, 'bug' is found and gets into the index.
Comment 3 Winfried Donkers 2015-07-21 06:21:19 UTC
Created attachment 117357 [details]
Second Writer document

This is the Writer document that used attachment 117356 [details] as concordance file. See previous comment for explanation.
Comment 4 Gordo 2015-07-24 16:59:53 UTC
There are two separate bugs here.  One is to do with Find and the other to do with creating an alphabetical index from a concordance file.  It is possible that some of the same code is used.

The issue is much broader though.  Comment and footnote/endnote anchors also affect Find; bookmarks do not.

Using the example "Alice Bob Charlie", if there is a comment at the end of "Alice" then Find will not be able to find "Alice Bob".  If there is a comment in the middle of "Alice" then Find will not be able to find "Alice".

As the index table is created, index entries are added which then affects its ability to find the other search terms in the concordance file.

Combining the two issues and using the second example document, if there is a comment in the middle of "writer" then that search term will not be found and no index entry will be added.

Windows Vista 64
Build ID: 2c39ebcf046445232b798108aa8a7e7d89552ea8
Comment 5 QA Administrators 2016-09-20 10:18:44 UTC Comment hidden (obsolete)
Comment 6 Winfried Donkers 2016-09-20 10:57:02 UTC
(In reply to QA Administrators from comment #5)

Problem still present in LO5.1.5.2 (x64, Windows).
Comment 7 Xisco Faulí 2017-09-29 08:50:33 UTC Comment hidden (obsolete)
Comment 8 Winfried Donkers 2017-10-02 10:09:40 UTC
Problem still present in LO5.3.6.1 (x64, Windows) and in LO-master (Linux).
Comment 9 QA Administrators 2018-10-03 02:54:21 UTC Comment hidden (obsolete)
Comment 10 Winfried Donkers 2018-10-03 07:47:22 UTC
Problem still present in LO6.0.6.2 (x64, Windows 10).
Comment 11 QA Administrators 2019-10-15 02:29:04 UTC Comment hidden (obsolete)
Comment 12 Winfried Donkers 2019-10-15 09:09:52 UTC
(In reply to QA Administrators from comment #11)
Problem still present in LO6.3.2.2 (x64, Windows 10).
Comment 13 BogdanB 2020-08-31 20:58:28 UTC
still here.
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 14 Heiko Tietze 2020-12-14 15:31:40 UTC
The concordance file uses Bob for both the search term and the alternative entry, which is weird. Having the alternative entry empty or using Charlie there makes the search work again. The difference between the two is the alphabetical-index-mark-end not being set. 

Without alternative entry:
<text:p text:style-name="P2">Alice <text:alphabetical-index-mark-start text:id="IMark94606775645288"/>Bob<text:alphabetical-index-mark-end text:id="IMark94606775645288"/> Charlie</text:p>

With "Bob" on both:
<text:p text:style-name="P2">Alice <text:alphabetical-index-mark text:string-value="Bob"/>Bob Charlie</text:p>

I could imagine this is a bug.

Footnotes (see comment 4) are probably another issue. But I don't see he we can avoid this. Do you, Michael?