Bug 491113 - Translation Memory search doesn’t use the default query syntax when searching
Summary: Translation Memory search doesn’t use the default query syntax when searching
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: translation memory (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-01 11:27 UTC by Karl Ove Hufthammer
Modified: 2024-08-07 21:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2024-08-01 11:27:27 UTC
SUMMARY
When opening the translation memory search (F7) and performing a search, the ‘Query syntax’ checkbox is set to ‘Substring’ by default. But the actual search seems to use a simple search for all strings contains all the words, typically resulting in very many (irrelevant) search results.


STEPS TO REPRODUCE
1. Ensure that the TM is filled with the contents of many files (‘Tools | Manage translation memories’). Here I have used a translation memory with all the files from the Norwegian Nynorsk KDE translation: svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-support/nn/summit/messages
2. Press F7 to open the TM search.
3. Perform a multi-word search, e.g., ‘play game’
4. Change the ‘Query syntax’ to ‘Wildcard’ and back again to ‘Substring’.
5. Repeat the search.

OBSERVED RESULT
After step 3, the search results is very long (for me: 188 entries) and includes strings that doesn’t contain the chosen substring (‘play game’), e.g.:
"Start a new game to play."
It also includes strings with words that the have the words as part of them:
"A spider playing computer games."

After step 5, a substring search is correctly performed, only resulting in (for me) 3 entries, e.g.:
"Replay game"
"… play games …"


EXPECTED RESULT
The result of step 3 should be equal to the result of step 5.

(It would also be nice if there were an option to restrict the search to whole word / word boundaries, so that ‘play’ wouldn’t match ‘replay’ and ’playing’, but I guess that’s a separate feature request.)


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240725
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.9.9-1-default (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-2500 CPU @ 3.30GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
Manufacturer: MSI
Product Name: MS-7673
System Version: 1.0
Comment 1 Bug Janitor Service 2024-08-06 23:07:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/144
Comment 2 Albert Astals Cid 2024-08-07 21:45:18 UTC
Git commit ceb66e00f42a019dc170249207a64c0e320974ad by Albert Astals Cid.
Committed on 07/08/2024 at 21:39.
Pushed by aacid into branch 'master'.

Translation Memory: Set correct query type on startup

M  +1    -0    src/tm/tmtab.cpp

https://invent.kde.org/sdk/lokalize/-/commit/ceb66e00f42a019dc170249207a64c0e320974ad
Comment 3 Albert Astals Cid 2024-08-07 21:49:48 UTC
Git commit c07c698c94a80822ecc6582ddab9074b3315a0cb by Albert Astals Cid.
Committed on 07/08/2024 at 21:49.
Pushed by aacid into branch 'release/24.08'.

Translation Memory: Set correct query type on startup
(cherry picked from commit ceb66e00f42a019dc170249207a64c0e320974ad)

M  +1    -0    src/tm/tmtab.cpp

https://invent.kde.org/sdk/lokalize/-/commit/c07c698c94a80822ecc6582ddab9074b3315a0cb