Add indexing for ListPreferences

- now support ListPreferences and save the "entries" attribute
- update Index database schema (and increment its version)
- do some clever stuff when showing Search results: if there is
a "$s" or "%s" in the summary (replacement strings), just use
the entries instead

Change-Id: If36595c3816706b6349faff7d3c2e725d3ea33f4
This commit is contained in:
Fabrice Di Meglio
2014-04-02 19:05:45 -07:00
parent f66eb7a8c8
commit a41707200b
5 changed files with 109 additions and 39 deletions

View File

@@ -28,7 +28,7 @@ public class IndexDatabaseHelper extends SQLiteOpenHelper {
private static final String TAG = "IndexDatabaseHelper";
private static final String DATABASE_NAME = "search_index.db";
private static final int DATABASE_VERSION = 104;
private static final int DATABASE_VERSION = 105;
public interface Tables {
public static final String TABLE_PREFS_INDEX = "prefs_index";
@@ -45,6 +45,7 @@ public class IndexDatabaseHelper extends SQLiteOpenHelper {
public static final String DATA_SUMMARY_ON_NORMALIZED = "data_summary_on_normalized";
public static final String DATA_SUMMARY_OFF = "data_summary_off";
public static final String DATA_SUMMARY_OFF_NORMALIZED = "data_summary_off_normalized";
public static final String DATA_ENTRIES = "data_entries";
public static final String DATA_KEYWORDS = "data_keywords";
public static final String CLASS_NAME = "class_name";
public static final String SCREEN_TITLE = "screen_title";
@@ -78,6 +79,8 @@ public class IndexDatabaseHelper extends SQLiteOpenHelper {
", " +
IndexColumns.DATA_SUMMARY_OFF_NORMALIZED +
", " +
IndexColumns.DATA_ENTRIES +
", " +
IndexColumns.DATA_KEYWORDS +
", " +
IndexColumns.SCREEN_TITLE +