After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722254 - Add tracker:normalize() and tracker:unaccent()
Add tracker:normalize() and tracker:unaccent()
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
0.17.x
Other All
: Normal enhancement
: ---
Assigned To: tracker-general
Depends on:
Blocks: 722246
 
 
Reported: 2014-01-15 10:51 UTC by Debarshi Ray
Modified: 2014-01-21 11:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch 1/3 (2.12 KB, patch)
2014-01-15 19:34 UTC, Aleksander Morgado
committed Details | Review
Patch 2/3 (6.42 KB, patch)
2014-01-15 19:34 UTC, Aleksander Morgado
committed Details | Review
Patch 3/3 (10.52 KB, patch)
2014-01-15 19:35 UTC, Aleksander Morgado
committed Details | Review

Description Debarshi Ray 2014-01-15 10:51:28 UTC
Search in gnome-documents basically does: "fn:contains (fn:lower-case (nie:title (?urn), str2))"

Given that all Unicode strings in the DB are not normalized, I would like to do:
  "fn:contains (tracker:case-fold (tracker:normalize (nie:title(?urn))), str2))"

See: https://bugzilla.gnome.org/show_bug.cgi?id=722246
Comment 1 Debarshi Ray 2014-01-15 11:49:04 UTC
We would also need a tracker:unaccent() so that accented alphabets can be matched with unaccented ones when searching.
Comment 2 Aleksander Morgado 2014-01-15 19:34:28 UTC
Created attachment 266381 [details] [review]
Patch 1/3
Comment 3 Aleksander Morgado 2014-01-15 19:34:46 UTC
Created attachment 266382 [details] [review]
Patch 2/3
Comment 4 Aleksander Morgado 2014-01-15 19:35:04 UTC
Created attachment 266383 [details] [review]
Patch 3/3
Comment 5 Debarshi Ray 2014-01-16 07:38:37 UTC
Aleksander, thanks for the patches. They appear to work perfectly for me. I wrote patches for gnome-documents in bug 722246
Comment 6 Martyn Russell 2014-01-17 19:00:37 UTC
Aleksander, outstanding work, please commit...
Comment 7 Martyn Russell 2014-01-17 19:01:50 UTC
Comment on attachment 266382 [details] [review]
Patch 2/3

Only comment here is that I would probably have put "Invalid normalization specified, options are 'nfc', 'nfd', 'nfkc' or 'nfkd'." So the person in error knows what they can use.
Comment 8 Aleksander Morgado 2014-01-21 11:19:37 UTC
Comment on attachment 266382 [details] [review]
Patch 2/3

updated the error string as suggested as well.
Comment 9 Aleksander Morgado 2014-01-21 11:20:10 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.