tracker r2547 - in trunk: . data/db src/libtracker-db
- From: jamiemcc svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2547 - in trunk: . data/db src/libtracker-db
- Date: Mon, 24 Nov 2008 04:51:31 +0000 (UTC)
Author: jamiemcc
Date: Mon Nov 24 04:51:31 2008
New Revision: 2547
URL: http://svn.gnome.org/viewvc/tracker?rev=2547&view=rev
Log:
2008-11-23 Jamie McCracken <jamiemcc at gnome org>
* data/db/sqlite-fulltext.sql
* data/db/Makefile.am
* src/libtracker-db/tracker-db-manager.c
* src/libtracker-db/tracker-db-manager.h:
Started integrating FTS into tracker
Added:
trunk/data/db/sqlite-fulltext.sql
Modified:
trunk/ChangeLog
trunk/data/db/Makefile.am
trunk/src/libtracker-db/tracker-db-manager.c
trunk/src/libtracker-db/tracker-db-manager.h
Modified: trunk/data/db/Makefile.am
==============================================================================
--- trunk/data/db/Makefile.am (original)
+++ trunk/data/db/Makefile.am Mon Nov 24 04:51:31 2008
@@ -7,6 +7,7 @@
sqlite-contents.sql \
sqlite-email.sql \
sqlite-metadata.sql \
+ sqlite-fulltext.sql \
sqlite-service.sql \
sqlite-service-triggers.sql \
sqlite-service-types.sql \
Added: trunk/data/db/sqlite-fulltext.sql
==============================================================================
--- (empty file)
+++ trunk/data/db/sqlite-fulltext.sql Mon Nov 24 04:51:31 2008
@@ -0,0 +1,258 @@
+create virtual table FullText using trackerfts (
+cat,
+col_default,
+col_1,
+col_2,
+col_3,
+col_4,
+col_5,
+col_6,
+col_7,
+col_8,
+col_9,
+col_10,
+col_11,
+col_12,
+col_13,
+col_14,
+col_15,
+col_16,
+col_17,
+col_18,
+col_19,
+col_20,
+col_21,
+col_22,
+col_23,
+col_24,
+col_25,
+col_26,
+col_27,
+col_28,
+col_29,
+col_30,
+col_31,
+col_32,
+col_33,
+col_34,
+col_35,
+col_36,
+col_37,
+col_38,
+col_39,
+col_40,
+col_41,
+col_42,
+col_43,
+col_44,
+col_45,
+col_46,
+col_47,
+col_48,
+col_49,
+col_50,
+col_51,
+col_52,
+col_53,
+col_54,
+col_55,
+col_56,
+col_57,
+col_58,
+col_59,
+col_60,
+col_61,
+col_62,
+col_63,
+col_64,
+col_65,
+col_66,
+col_67,
+col_68,
+col_69,
+col_70,
+col_71,
+col_72,
+col_73,
+col_74,
+col_75,
+col_76,
+col_77,
+col_78,
+col_79,
+col_80,
+col_81,
+col_82,
+col_83,
+col_84,
+col_85,
+col_86,
+col_87,
+col_88,
+col_89,
+col_90,
+col_91,
+col_92,
+col_93,
+col_94,
+col_95,
+col_96,
+col_97,
+col_98,
+col_99,
+col_100,
+col_101,
+col_102,
+col_103,
+col_104,
+col_105,
+col_106,
+col_107,
+col_108,
+col_109,
+col_110,
+col_111,
+col_112,
+col_113,
+col_114,
+col_115,
+col_116,
+col_117,
+col_118,
+col_119,
+col_120,
+col_121,
+col_122,
+col_123,
+col_124,
+col_125,
+col_126,
+col_127,
+col_128,
+col_129,
+col_130,
+col_131,
+col_132,
+col_133,
+col_134,
+col_135,
+col_136,
+col_137,
+col_138,
+col_139,
+col_140,
+col_141,
+col_142,
+col_143,
+col_144,
+col_145,
+col_146,
+col_147,
+col_148,
+col_149,
+col_150,
+col_151,
+col_152,
+col_153,
+col_154,
+col_155,
+col_156,
+col_157,
+col_158,
+col_159,
+col_160,
+col_161,
+col_162,
+col_163,
+col_164,
+col_165,
+col_166,
+col_167,
+col_168,
+col_169,
+col_170,
+col_171,
+col_172,
+col_173,
+col_174,
+col_175,
+col_176,
+col_177,
+col_178,
+col_179,
+col_180,
+col_181,
+col_182,
+col_183,
+col_184,
+col_185,
+col_186,
+col_187,
+col_188,
+col_189,
+col_190,
+col_191,
+col_192,
+col_193,
+col_194,
+col_195,
+col_196,
+col_197,
+col_198,
+col_199,
+col_200,
+col_201,
+col_202,
+col_203,
+col_204,
+col_205,
+col_206,
+col_207,
+col_208,
+col_209,
+col_210,
+col_211,
+col_212,
+col_213,
+col_214,
+col_215,
+col_216,
+col_217,
+col_218,
+col_219,
+col_220,
+col_221,
+col_222,
+col_223,
+col_224,
+col_225,
+col_226,
+col_227,
+col_228,
+col_229,
+col_230,
+col_231,
+col_232,
+col_233,
+col_234,
+col_235,
+col_236,
+col_237,
+col_238,
+col_239,
+col_240,
+col_241,
+col_242,
+col_243,
+col_244,
+col_245,
+col_246,
+col_247,
+col_248,
+col_249,
+col_250,
+col_251,
+col_252,
+col_253,
+col_254,
+col_255);
Modified: trunk/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.c (original)
+++ trunk/src/libtracker-db/tracker-db-manager.c Mon Nov 24 04:51:31 2008
@@ -74,6 +74,7 @@
gint page_size;
gboolean add_functions;
gboolean attached;
+ gboolean is_index;
} TrackerDBDefinition;
static TrackerDBDefinition dbs[] = {
@@ -86,6 +87,7 @@
32,
TRACKER_DB_PAGE_SIZE_DEFAULT,
FALSE,
+ FALSE,
FALSE },
{ TRACKER_DB_COMMON,
TRACKER_DB_LOCATION_USER_DATA_DIR,
@@ -96,6 +98,7 @@
32,
TRACKER_DB_PAGE_SIZE_DEFAULT,
FALSE,
+ FALSE,
FALSE },
{ TRACKER_DB_CACHE,
TRACKER_DB_LOCATION_SYS_TMP_DIR,
@@ -106,6 +109,7 @@
128,
TRACKER_DB_PAGE_SIZE_DONT_SET,
FALSE,
+ FALSE,
FALSE },
{ TRACKER_DB_FILE_METADATA,
TRACKER_DB_LOCATION_DATA_DIR,
@@ -116,7 +120,19 @@
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
TRUE,
+ FALSE,
FALSE },
+ { TRACKER_DB_FILE_FULLTEXT,
+ TRACKER_DB_LOCATION_DATA_DIR,
+ NULL,
+ "file-fulltext.db",
+ "file-fulltext",
+ NULL,
+ 512,
+ TRACKER_DB_PAGE_SIZE_DEFAULT,
+ TRUE,
+ FALSE,
+ TRUE },
{ TRACKER_DB_FILE_CONTENTS,
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
@@ -126,6 +142,7 @@
1024,
TRACKER_DB_PAGE_SIZE_DEFAULT,
FALSE,
+ FALSE,
FALSE },
{ TRACKER_DB_EMAIL_METADATA,
TRACKER_DB_LOCATION_DATA_DIR,
@@ -137,6 +154,17 @@
TRACKER_DB_PAGE_SIZE_DEFAULT,
TRUE,
FALSE},
+ { TRACKER_DB_EMAIL_FULLTEXT,
+ TRACKER_DB_LOCATION_DATA_DIR,
+ NULL,
+ "email-fulltext.db",
+ "email-fulltext",
+ NULL,
+ 512,
+ TRACKER_DB_PAGE_SIZE_DEFAULT,
+ TRUE,
+ FALSE,
+ TRUE},
{ TRACKER_DB_EMAIL_CONTENTS,
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
@@ -146,6 +174,7 @@
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
FALSE,
+ FALSE,
FALSE },
{ TRACKER_DB_XESAM,
TRACKER_DB_LOCATION_DATA_DIR,
@@ -156,6 +185,7 @@
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
TRUE,
+ FALSE,
FALSE },
};
@@ -1984,6 +2014,23 @@
}
static TrackerDBInterface *
+db_interface_get_file_fulltext (void)
+{
+ TrackerDBInterface *iface;
+ gboolean create;
+
+ iface = db_interface_get (TRACKER_DB_FILE_FULLTEXT, &create);
+
+ if (create) {
+ tracker_db_interface_start_transaction (iface);
+ load_sql_file (iface, "sqlite-fulltext.sql", NULL);
+ tracker_db_interface_end_transaction (iface);
+ }
+
+ return iface;
+}
+
+static TrackerDBInterface *
db_interface_get_file_contents (void)
{
TrackerDBInterface *iface;
@@ -2009,6 +2056,8 @@
return iface;
}
+
+
static TrackerDBInterface *
db_interface_get_email_metadata (void)
{
@@ -2029,6 +2078,23 @@
}
static TrackerDBInterface *
+db_interface_get_email_fulltext (void)
+{
+ TrackerDBInterface *iface;
+ gboolean create;
+
+ iface = db_interface_get (TRACKER_DB_EMAIL_FULLTEXT, &create);
+
+ if (create) {
+ tracker_db_interface_start_transaction (iface);
+ load_sql_file (iface, "sqlite-fulltext.sql", NULL);
+ tracker_db_interface_end_transaction (iface);
+ }
+
+ return iface;
+}
+
+static TrackerDBInterface *
db_interface_get_email_contents (void)
{
TrackerDBInterface *iface;
@@ -2301,13 +2367,19 @@
case TRACKER_DB_FILE_METADATA:
return db_interface_get_file_metadata ();
+
+ case TRACKER_DB_FILE_FULLTEXT:
+ return db_interface_get_file_fulltext ();
case TRACKER_DB_FILE_CONTENTS:
return db_interface_get_file_contents ();
case TRACKER_DB_EMAIL_METADATA:
return db_interface_get_email_metadata ();
-
+
+ case TRACKER_DB_EMAIL_FULLTEXT:
+ return db_interface_get_email_fulltext ();
+
case TRACKER_DB_EMAIL_CONTENTS:
return db_interface_get_email_contents ();
Modified: trunk/src/libtracker-db/tracker-db-manager.h
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.h (original)
+++ trunk/src/libtracker-db/tracker-db-manager.h Mon Nov 24 04:51:31 2008
@@ -35,13 +35,16 @@
TRACKER_DB_CACHE,
TRACKER_DB_FILE_METADATA,
TRACKER_DB_FILE_CONTENTS,
+ TRACKER_DB_FILE_FULLTEXT,
TRACKER_DB_EMAIL_METADATA,
TRACKER_DB_EMAIL_CONTENTS,
+ TRACKER_DB_EMAIL_FULLTEXT,
TRACKER_DB_XESAM,
} TrackerDB;
typedef enum {
TRACKER_DB_CONTENT_TYPE_METADATA,
+ TRACKER_DB_CONTENT_TYPE_INDEX,
TRACKER_DB_CONTENT_TYPE_CONTENTS
} TrackerDBContentType;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]