Since tracker 0.9.19, collation-based ordering is always applied to text columns.
The collation function in tracker is implemented using all the three Unicode support libraries:
The collation function is registered in every text column when the tables are created in SQLite.
- The collation depends directly on the current locale settings of the user (LC_COLLATE).
- Index on columns:
- Every index created for a text column will also be based on the registered collation function.
When an ORDER BY is requested on the values of a column without index, the collation function will be used on-the-fly during the ordering of the query results.
When an ORDER BY is requested on the values of a column with index, the order is taken directly from the index, which was created using the locale settings detected by the tracker-store.
If a locale change is detected by the tracker-store, all indexes will be recreated.
- Collation keys:
Collation keys are neither exposed nor computed by tracker. This means that the collation based ordering is done using directly the collation function whenever needed.
- Tracker will internally use the default Unicode collation function, as provided by glib, libunistring or libicu. If the user wants to merge the results of several independent queries and order them based on collation, she will need to use the same Unicode collation function and the same locale settings.