I have filenames with underscores "_" in them separating information encoded in them e.g. "56_1607099331_270_3.tif" where the information is an id, a timestamp, a rotation angle and a camera id. To tag those files properly I wanted to use the (mighty) search tool, but there are several things working differently than expected: Using the "keyword search" (not the "advanced search") with "_270_" also yields results with filenames containing e.g. "12709". Obviously this field does not use usual wildcards for file managers ("*" and "?") but the database (in my case SQLite) ones for a "LIKE" query which are "_" and "%". This is not documented on https://docs.kde.org/trunk5/en/extragear-graphics/digikam/using-digikam.html#using-mainwindow-searchesview, instead it is stated that special characters are ignored. It is not possible (or I did not find how) to escape those characters to search for a "real" underscore e.g. escaping with "\" (even multiple ones) does not work. The same applies for the advanced search with the "File name" field. Thanks in advance for having a look into that issue and the great work on this software.
The search works when I search for "\_270\_" (without quotation marks). Maik
Ok, it works with MySQL but not with SQLite. Maik
Git commit 5e87ffe78349f56a6da3f8ddee62095074d725ff by Maik Qualmann. Committed on 08/12/2020 at 19:32. Pushed by mqualmann into branch 'master'. add escape character '\' to LIKE search with SQLite FIXED-IN: 7.2.0 M +2 -1 NEWS M +12 -1 core/libs/database/item/query/fieldquerybuilder.cpp https://invent.kde.org/graphics/digikam/commit/5e87ffe78349f56a6da3f8ddee62095074d725ff
Thanks for the quick fix. So the wildcards "_" and "%" will still be usable and have to be escaped if one needs to use them as literal? Could one please update the documentation accordingly as wildcards may be of nice use, but I think most people will try "*" and "?" otherwise if at all.