tracker r1716 - in branches/indexer-split: . data/dbus src/libtracker src/libtracker-common src/trackerd



Author: mr
Date: Thu Jun 19 12:31:38 2008
New Revision: 1716
URL: http://svn.gnome.org/viewvc/tracker?rev=1716&view=rev

Log:
	* data/dbus/tracker-files.xml:
	* data/dbus/tracker-keywords.xml:
	* data/dbus/tracker-metadata.xml:
	* data/dbus/tracker-search.xml: Re-added the Nautilus API we
	commented out and set all API which is to be removed as deprecated.

	* src/libtracker/tracker.c: 
	* src/trackerd/tracker-db.[ch]: 
	* src/trackerd/tracker-files.[ch]:
	* src/trackerd/tracker-metadata.c: Readded and fixed APIs relating
	to XML file changes.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/data/dbus/tracker-files.xml
   branches/indexer-split/data/dbus/tracker-keywords.xml
   branches/indexer-split/data/dbus/tracker-metadata.xml
   branches/indexer-split/data/dbus/tracker-search.xml
   branches/indexer-split/src/libtracker-common/tracker-config.c
   branches/indexer-split/src/libtracker/tracker.c
   branches/indexer-split/src/trackerd/tracker-db.c
   branches/indexer-split/src/trackerd/tracker-db.h
   branches/indexer-split/src/trackerd/tracker-files.c
   branches/indexer-split/src/trackerd/tracker-files.h
   branches/indexer-split/src/trackerd/tracker-metadata.c

Modified: branches/indexer-split/data/dbus/tracker-files.xml
==============================================================================
--- branches/indexer-split/data/dbus/tracker-files.xml	(original)
+++ branches/indexer-split/data/dbus/tracker-files.xml	Thu Jun 19 12:31:38 2008
@@ -41,6 +41,7 @@
 	 specify the offset and amount of text to retrieve.
       -->
     <method name="GetTextContents">
+      <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="uri" direction="in" />
       <arg type="i" name="offset"  direction="in" />
       <arg type="i" name="max_length"  direction="in" />				
@@ -51,6 +52,7 @@
 	 contains the search text in the File.Content field.
       -->
     <method name="SearchTextContents">
+      <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="uri" direction="in" />
       <arg type="s" name="text"  direction="in" />
       <arg type="i" name="length"  direction="in" />
@@ -86,6 +88,7 @@
 
     <!-- returns mtime of file in seconds since epoch -->
     <method name="GetMTime">
+      <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="uri" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
@@ -101,27 +104,23 @@
       <arg type="aas" name="values" direction="out" />
     </method>
 
-    <!-- Deprecated file specific calls.
-	 (mostly used by Nautilus search). 
-      -->
-      
-<!--
+    <!-- Specific calls for Nautilus, mostly used by Nautilus search. -->
     <method name="SearchByTextAndMime">
       <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="text" direction="in" />
       <arg type="as" name="mimes" direction="in" />
       <arg type="as" name="result" direction="out" />
     </method>
-    <method name="SearchByTextAndMimeAndLocation">
+    <method name="SearchByTextAndLocation">
       <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="text" direction="in" />
-      <arg type="as" name="mimes" direction="in" />
       <arg type="s" name="location" direction="in" />
       <arg type="as" name="result" direction="out" />
     </method>
-    <method name="SearchByTextAndLocation">
+    <method name="SearchByTextAndMimeAndLocation">
       <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="text" direction="in" />
+      <arg type="as" name="mimes" direction="in" />
       <arg type="s" name="location" direction="in" />
       <arg type="as" name="result" direction="out" />
     </method>

Modified: branches/indexer-split/data/dbus/tracker-keywords.xml
==============================================================================
--- branches/indexer-split/data/dbus/tracker-keywords.xml	(original)
+++ branches/indexer-split/data/dbus/tracker-keywords.xml	Thu Jun 19 12:31:38 2008
@@ -47,6 +47,7 @@
 	 returns an array of matching id values for the service.
       --> 
     <method name="Search">
+      <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="i" name="live_query_id" direction="in" />
       <arg type="s" name="service" direction="in" />
       <arg type="as" name="keywords" direction="in" />

Modified: branches/indexer-split/data/dbus/tracker-metadata.xml
==============================================================================
--- branches/indexer-split/data/dbus/tracker-metadata.xml	(original)
+++ branches/indexer-split/data/dbus/tracker-metadata.xml	Thu Jun 19 12:31:38 2008
@@ -21,26 +21,7 @@
       <arg type="as" name="keys" direction="in" />
       <arg type="as" name="values" direction="in" />
     </method>
-    
-    <!--
-       Registers a new metadata type. The metadata name must be
-       namespaced with an appropriate class in the format
-       "class.name".
-       
-       The datatype argument for RegisterType should be one of the
-       following: 
-       "index"   (a string which is stored in a full text index for searching)
-       "string"  (a non-indexable string which will not show up in searches)
-       "numeric" (a signed number which can be either an integer or a float)
-       "date"    (format should be "yyyy-mm-dd hh:mm:ss")
        
-       Metadata defined here is considered non-embeddable and writable.
-      -->
-    <method name="RegisterType">
-      <arg type="s" name="name" direction="in" />
-      <arg type="s" name="datatype" direction="in" />
-    </method>
-    
     <!-- Gets all details of a named metadata type. -->		
     <method name="GetTypeDetails">
       <arg type="s" name="name" direction="in" />
@@ -57,16 +38,7 @@
       <arg type="s" name="metadata_class" direction="in" />
       <arg type="as" name="result" direction="out" />
     </method>
-    
-    <!-- Returns an array of all metadata types that are writeable and
-	 registered for a certain class. You can enter "*" as the class
-	 to get all metadat types for all classes that are writeable.
-      -->
-    <method name="GetWritableTypes">
-      <arg type="s" name="metadata_class" direction="in" />
-      <arg type="as" name="result" direction="out" />
-    </method>
-    
+       
     <!-- Returns an array of all metadata type classes that are
 	 registered.
       -->

Modified: branches/indexer-split/data/dbus/tracker-search.xml
==============================================================================
--- branches/indexer-split/data/dbus/tracker-search.xml	(original)
+++ branches/indexer-split/data/dbus/tracker-search.xml	Thu Jun 19 12:31:38 2008
@@ -57,6 +57,7 @@
 	 search term (search_text). The result is an array of uri/id's.
       -->
     <method name="Metadata">
+      <annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
       <arg type="s" name="service" direction="in" />
       <arg type="s" name="field" direction="in" />
       <arg type="s" name="search_text"  direction="in" />

Modified: branches/indexer-split/src/libtracker-common/tracker-config.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-config.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-config.c	Thu Jun 19 12:31:38 2008
@@ -160,7 +160,7 @@
 	gint	  thread_stack_size;
 
 	/* Services*/
-	gboolean enable_xesam;
+	gboolean  enable_xesam;
 };
 
 static void config_finalize	(GObject      *object);

Modified: branches/indexer-split/src/libtracker/tracker.c
==============================================================================
--- branches/indexer-split/src/libtracker/tracker.c	(original)
+++ branches/indexer-split/src/libtracker/tracker.c	Thu Jun 19 12:31:38 2008
@@ -455,10 +455,8 @@
 void
 tracker_metadata_register_type	(TrackerClient *client, const char *name, MetadataTypes type, GError **error)
 {
-	char *meta_type = metadata_types[type];
-
-	org_freedesktop_Tracker_Metadata_register_type  (client->proxy_metadata, name, meta_type, &*error);
-
+        /* This does nothing now, this API has been removed */
+        g_warning ("%s no longer does anything", __FUNCTION__);
 }
 
 MetaDataTypeDetails *	
@@ -493,13 +491,10 @@
 char **		
 tracker_metadata_get_writeable_types (TrackerClient *client, const char *class, GError **error)
 {
-	char **array = NULL;
-
-	if (!org_freedesktop_Tracker_Metadata_get_writable_types  (client->proxy_metadata, class, &array, &*error)) {
-		return NULL;
-	}
-
-	return array;
+        /* This does nothing now, this API has been removed */
+        g_warning ("%s no longer does anything", __FUNCTION__);
+        
+        return NULL;
 }
 
 
@@ -839,10 +834,44 @@
 
 
 
+char ** 	 
+tracker_search_metadata_by_text_and_mime (TrackerClient *client, const char *query, const char **mimes, GError **error) 	 
+{ 	 
+        char **strs; 	 
+	
+        if (!org_freedesktop_Tracker_Files_search_by_text_and_mime  (client->proxy_files, query,(const char **) mimes, &strs, &*error)) { 	 
+                return NULL; 	 
+        } 	 
+        return strs; 	 
+	
+} 	 
+
 
+char ** 	 
+tracker_search_metadata_by_text_and_mime_and_location (TrackerClient *client, const char *query, const char **mimes, const char *location, GError **error) 	 
+{ 	 
+        char **strs; 	 
+	
+        if (!org_freedesktop_Tracker_Files_search_by_text_and_mime_and_location (client->proxy_files, query, (const char **)mimes, location, &strs, &*error)) { 	 
+                return NULL; 	 
+        } 	 
+        return strs; 	 
+	
+} 	 
 
 
 
+char ** 	 
+tracker_search_metadata_by_text_and_location (TrackerClient *client, const char *query, const char *location, GError **error) 	 
+{ 	 
+        char **strs; 	 
+	
+        if (!org_freedesktop_Tracker_Files_search_by_text_and_location (client->proxy_files, query, location, &strs, &*error)) { 	 
+                return NULL; 	 
+        } 	 
+        return strs; 	 
+	
+}
 
 
 
@@ -1006,10 +1035,10 @@
 	callback_struct->callback = callback;
 	callback_struct->data = user_data;
 
-	char *meta_type = metadata_types[type];
-
-	client->last_pending_call = org_freedesktop_Tracker_Metadata_register_type_async  (client->proxy_metadata, name, meta_type, tracker_void_reply, callback_struct);
+        /* This does nothing now, this API has been removed */
+        g_warning ("%s no longer does anything", __FUNCTION__);
 
+        tracker_void_reply (client->proxy_metadata, NULL, callback_struct);
 }
 
 
@@ -1041,8 +1070,10 @@
 	callback_struct->data = user_data;
 
 
-	client->last_pending_call = org_freedesktop_Tracker_Metadata_get_writable_types_async  (client->proxy_metadata, class, tracker_array_reply, callback_struct);
+        /* This does nothing now, this API has been removed */
+        g_warning ("%s no longer does anything", __FUNCTION__);
 
+        tracker_void_reply (client->proxy_metadata, NULL, callback_struct);
 }
 
 

Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db.c	Thu Jun 19 12:31:38 2008
@@ -614,6 +614,29 @@
 	return 0;
 }
 
+static GArray *
+db_create_array_of_services (void)
+{
+	GArray *array;
+	gint    services[8];
+	gint    count = 0;
+
+	/* FIXME: Shouldn't we add emails and GAIM conversaions? -mr */
+	services[count++] = tracker_ontology_get_id_for_service_type ("Folders");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Documents");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Images");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Videos");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Music");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Text");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Development");
+	services[count++] = tracker_ontology_get_id_for_service_type ("Other");
+
+	array = g_array_new (TRUE, TRUE, sizeof (gint));
+	g_array_append_vals (array, services, G_N_ELEMENTS (services));
+
+	return array;
+}
+
 void
 tracker_db_init (void)
 {
@@ -917,6 +940,301 @@
 }
 
 TrackerDBResultSet *
+tracker_db_search_text_and_mime (TrackerDBInterface  *iface, 
+				 const gchar         *text, 
+				 gchar              **mime_array)
+{
+	TrackerQueryTree   *tree;
+	TrackerDBResultSet *result_set1;
+	GArray             *hits;
+	GArray             *services;
+	gint                count = 0;
+	guint               i; 
+
+	g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+	g_return_val_if_fail (text != NULL, NULL);
+	g_return_val_if_fail (mime_array != NULL, NULL);
+
+	result_set1 = NULL;
+	services = db_create_array_of_services ();
+
+	tree = tracker_query_tree_new (text, 
+				       tracker->file_index, 
+				       tracker->config,
+				       tracker->language,
+				       services);
+	hits = tracker_query_tree_get_hits (tree, 0, 0);
+
+	for (i = 0, count = 0; i < hits->len; i++) {
+		TrackerDBResultSet *result_set2;
+		TrackerSearchHit    hit;
+		gchar              *str_id, *mimetype;
+
+		hit = g_array_index (hits, TrackerSearchHit, i);
+
+		str_id = tracker_uint_to_string (hit.service_id);
+		result_set2 = tracker_db_exec_proc (iface, 
+						    "GetFileByID", 
+						    str_id, 
+						    NULL);
+		g_free (str_id);
+
+		if (result_set2) {
+			tracker_db_result_set_get (result_set2, 2, &mimetype, -1);
+
+			if (tracker_string_in_string_list (mimetype, mime_array) != -1) {
+				GValue value = { 0, };
+
+				if (G_UNLIKELY (!result_set1)) {
+					result_set1 = _tracker_db_result_set_new (2);
+				}
+
+				_tracker_db_result_set_append (result_set1);
+
+				/* copy value in column 0 */
+				_tracker_db_result_set_get_value (result_set2, 0, &value);
+				_tracker_db_result_set_set_value (result_set1, 0, &value);
+				g_value_unset (&value);
+
+				/* copy value in column 1 */
+				_tracker_db_result_set_get_value (result_set2, 1, &value);
+				_tracker_db_result_set_set_value (result_set1, 1, &value);
+				g_value_unset (&value);
+
+				count++;
+			}
+
+			g_free (mimetype);
+			g_object_unref (result_set2);
+		}
+
+		if (count > 2047) {
+			g_warning ("Count is > 2047? Breaking for loop in %s, why?", 
+				   __FUNCTION__);
+			break;
+		}
+	}
+
+	g_object_unref (tree);
+	g_array_free (hits, TRUE);
+	g_array_free (services, TRUE);
+
+	if (!result_set1) {
+		return NULL;
+	}
+
+	if (tracker_db_result_set_get_n_rows (result_set1) == 0) {
+		g_object_unref (result_set1);
+		return NULL;
+	}
+
+	tracker_db_result_set_rewind (result_set1);
+
+	return result_set1;
+}
+
+TrackerDBResultSet *
+tracker_db_search_text_and_location (TrackerDBInterface *iface,
+				     const gchar        *text, 
+				     const gchar        *location)
+{
+	TrackerDBResultSet *result_set1;
+	TrackerQueryTree   *tree;
+	GArray             *hits;
+	GArray             *services;
+	gchar	           *location_prefix;
+	gint 	            count;
+	guint               i;
+
+	g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+	g_return_val_if_fail (text != NULL, NULL);
+	g_return_val_if_fail (location != NULL, NULL);
+
+	result_set1 = NULL;
+	location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
+	services = db_create_array_of_services ();
+
+	tree = tracker_query_tree_new (text, 
+				       tracker->file_index, 
+				       tracker->config,
+				       tracker->language,
+				       services);
+	hits = tracker_query_tree_get_hits (tree, 0, 0);
+
+	for (i = 0, count = 0; i < hits->len; i++) {
+		TrackerDBResultSet *result_set2;
+		TrackerSearchHit    hit;
+		gchar              *str_id, *path;
+
+		hit = g_array_index (hits, TrackerSearchHit, i);
+
+		str_id = tracker_uint_to_string (hit.service_id);
+		result_set2 = tracker_db_exec_proc (iface, 
+						   "GetFileByID", 
+						   str_id, 
+						   NULL);
+		g_free (str_id);
+
+		if (result_set2) {
+			tracker_db_result_set_get (result_set2, 0, &path, -1);
+
+			if (g_str_has_prefix (path, location_prefix) || 
+			    strcmp (path, location) == 0) {
+				GValue value = { 0, };
+
+				if (G_UNLIKELY (!result_set1)) {
+					result_set1 = _tracker_db_result_set_new (2);
+				}
+
+				_tracker_db_result_set_append (result_set1);
+
+				/* copy value in column 0 */
+				_tracker_db_result_set_get_value (result_set2, 0, &value);
+				_tracker_db_result_set_set_value (result_set1, 0, &value);
+				g_value_unset (&value);
+
+				/* copy value in column 1 */
+				_tracker_db_result_set_get_value (result_set2, 1, &value);
+				_tracker_db_result_set_set_value (result_set1, 1, &value);
+				g_value_unset (&value);
+
+				count++;
+			}
+
+			g_object_unref (result_set2);
+		}
+
+		if (count > 2047) {
+			g_warning ("Count is > 2047? Breaking for loop in %s, why?", 
+				   __FUNCTION__);
+			break;
+		}
+	}
+
+	g_free (location_prefix);
+	g_object_unref (tree);
+	g_array_free (hits, TRUE);
+	g_array_free (services, TRUE);
+
+	if (!result_set1) {
+		return NULL;
+	}
+
+	if (tracker_db_result_set_get_n_rows (result_set1) == 0) {
+		g_object_unref (result_set1);
+		return NULL;
+	}
+
+	tracker_db_result_set_rewind (result_set1);
+
+	return result_set1;
+}
+
+TrackerDBResultSet *
+tracker_db_search_text_and_mime_and_location (TrackerDBInterface  *iface,
+					      const gchar         *text, 
+					      gchar              **mime_array, 
+					      const gchar         *location)
+{
+	TrackerDBResultSet *result_set1;
+	TrackerQueryTree   *tree;
+	GArray             *hits;
+	GArray             *services;
+	gchar	           *location_prefix;
+	gint 	            count;
+	guint               i;
+
+	g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+	g_return_val_if_fail (text != NULL, NULL);
+	g_return_val_if_fail (location != NULL, NULL);
+
+	result_set1 = NULL;
+	location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
+	services = db_create_array_of_services ();
+
+	tree = tracker_query_tree_new (text, 
+				       tracker->file_index, 
+				       tracker->config,
+				       tracker->language,
+				       services);
+	hits = tracker_query_tree_get_hits (tree, 0, 0);
+
+	for (i = 0, count = 0; i < hits->len; i++) {
+		TrackerDBResultSet *result_set2;
+		TrackerSearchHit    hit;
+		gchar              *str_id, *path, *mimetype;
+
+		hit = g_array_index (hits, TrackerSearchHit, i);
+
+		str_id = tracker_uint_to_string (hit.service_id);
+		result_set2 = tracker_db_exec_proc (iface, 
+						   "GetFileByID", 
+						   str_id, 
+						   NULL);
+		g_free (str_id);
+
+		if (result_set2) {
+			tracker_db_result_set_get (result_set2,
+						   0, &path,
+						   2, &mimetype,
+						   -1);
+
+			if ((g_str_has_prefix (path, location_prefix) || 
+			     strcmp (path, location) == 0) &&
+			    tracker_string_in_string_list (mimetype, mime_array) != -1) {
+				GValue value = { 0, };
+
+				if (G_UNLIKELY (!result_set1)) {
+					result_set1 = _tracker_db_result_set_new (2);
+				}
+
+				_tracker_db_result_set_append (result_set1);
+
+				/* copy value in column 0 */
+				_tracker_db_result_set_get_value (result_set2, 0, &value);
+				_tracker_db_result_set_set_value (result_set1, 0, &value);
+				g_value_unset (&value);
+
+				/* copy value in column 1 */
+				_tracker_db_result_set_get_value (result_set2, 1, &value);
+				_tracker_db_result_set_set_value (result_set1, 1, &value);
+				g_value_unset (&value);
+
+				count++;
+			}
+
+			g_free (path);
+			g_free (mimetype);
+			g_object_unref (result_set2);
+		}
+
+		if (count > 2047) {
+			g_warning ("Count is > 2047? Breaking for loop in %s, why?", 
+				   __FUNCTION__);
+			break;
+		}
+	}
+
+	g_free (location_prefix);
+	g_object_unref (tree);
+	g_array_free (hits, TRUE);
+	g_array_free (services, TRUE);
+
+	if (!result_set1) {
+		return NULL;
+	}
+
+	if (tracker_db_result_set_get_n_rows (result_set1) == 0) {
+		g_object_unref (result_set1);
+		return NULL;
+	}
+
+	tracker_db_result_set_rewind (result_set1);
+
+	return result_set1;
+}
+
+TrackerDBResultSet *
 tracker_db_metadata_get (TrackerDBInterface *iface, 
 			 const gchar        *id, 
 			 const gchar        *key)

Modified: branches/indexer-split/src/trackerd/tracker-db.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-db.h	Thu Jun 19 12:31:38 2008
@@ -38,194 +38,204 @@
 
 G_BEGIN_DECLS
 
-void                tracker_db_init                            (void);
-void                tracker_db_shutdown                        (void);
+void                tracker_db_init                              (void);
+void                tracker_db_shutdown                          (void);
 
 /* Operations for TrackerDBInterface */
-TrackerDBResultSet *tracker_db_exec_proc                       (TrackerDBInterface  *iface,
-								const gchar         *procedure,
-								...);
-gboolean            tracker_db_exec_no_reply                   (TrackerDBInterface  *iface,
-								const gchar         *query,
-								...);
-TrackerDBResultSet *tracker_db_exec                            (TrackerDBInterface  *iface,
-								const char          *query,
-								...);
-gchar *             tracker_db_get_option_string               (const gchar         *option);
-void                tracker_db_set_option_string               (const gchar         *option,
-								const gchar         *value);
-gint                tracker_db_get_option_int                  (const gchar         *option);
-void                tracker_db_set_option_int                  (const gchar         *option,
-								gint                 value);
+TrackerDBResultSet *tracker_db_exec_proc                         (TrackerDBInterface  *iface,
+								  const gchar         *procedure,
+								  ...);
+gboolean            tracker_db_exec_no_reply                     (TrackerDBInterface  *iface,
+								  const gchar         *query,
+								  ...);
+TrackerDBResultSet *tracker_db_exec                              (TrackerDBInterface  *iface,
+								  const char          *query,
+								  ...);
+gchar *             tracker_db_get_option_string                 (const gchar         *option);
+void                tracker_db_set_option_string                 (const gchar         *option,
+								  const gchar         *value);
+gint                tracker_db_get_option_int                    (const gchar         *option);
+void                tracker_db_set_option_int                    (const gchar         *option,
+								  gint                 value);
 
 /* High level transactions things */
-gboolean            tracker_db_regulate_transactions           (TrackerDBInterface  *iface,
-								gint                 interval);
+gboolean            tracker_db_regulate_transactions             (TrackerDBInterface  *iface,
+								  gint                 interval);
 
 /* Metadata API */
-gchar *             tracker_db_metadata_get_related_names      (TrackerDBInterface  *iface,
-								const gchar         *name);
-const gchar *       tracker_db_metadata_get_table              (TrackerFieldType     type);
-TrackerDBResultSet *tracker_db_metadata_get                    (TrackerDBInterface  *iface,
-								const gchar         *id,
-								const gchar         *key);
-gchar *             tracker_db_metadata_get_delimited          (TrackerDBInterface  *iface,
-								const gchar         *id,
-								const gchar         *key);
-gchar *             tracker_db_metadata_set                    (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								gchar              **values,
-								gboolean             do_backup);
-void                tracker_db_metadata_set_single             (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								const gchar         *value,
-								gboolean             do_backup);
-void                tracker_db_metadata_insert_embedded        (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								gchar              **values,
-								GHashTable          *table);
-void                tracker_db_metadata_insert_single_embedded (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								const gchar         *value,
-								GHashTable          *table);
-void                tracker_db_metadata_delete_value           (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								const gchar         *value);
-void                tracker_db_metadata_delete                 (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *id,
-								const gchar         *key,
-								gboolean             update_indexes);
-TrackerDBResultSet *tracker_db_metadata_get_types              (TrackerDBInterface  *iface,
-								const gchar         *class,
-								gboolean             writeable);
+gchar *             tracker_db_metadata_get_related_names        (TrackerDBInterface  *iface,
+								  const gchar         *name);
+const gchar *       tracker_db_metadata_get_table                (TrackerFieldType     type);
+TrackerDBResultSet *tracker_db_metadata_get                      (TrackerDBInterface  *iface,
+								  const gchar         *id,
+								  const gchar         *key);
+gchar *             tracker_db_metadata_get_delimited            (TrackerDBInterface  *iface,
+								  const gchar         *id,
+								  const gchar         *key);
+gchar *             tracker_db_metadata_set                      (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  gchar              **values,
+								  gboolean             do_backup);
+void                tracker_db_metadata_set_single               (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  const gchar         *value,
+								  gboolean             do_backup);
+void                tracker_db_metadata_insert_embedded          (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  gchar              **values,
+								  GHashTable          *table);
+void                tracker_db_metadata_insert_single_embedded   (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  const gchar         *value,
+								  GHashTable          *table);
+void                tracker_db_metadata_delete_value             (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  const gchar         *value);
+void                tracker_db_metadata_delete                   (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *id,
+								  const gchar         *key,
+								  gboolean             update_indexes);
+TrackerDBResultSet *tracker_db_metadata_get_types                (TrackerDBInterface  *iface,
+								  const gchar         *class,
+								  gboolean             writeable);
 
 /* Search API */
-TrackerDBResultSet *tracker_db_search_text                     (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *search_string,
-								gint                 offset,
-								gint                 limit,
-								gboolean             save_results,
-								gboolean             detailed);
+TrackerDBResultSet *tracker_db_search_text                       (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *search_string,
+								  gint                 offset,
+								  gint                 limit,
+								  gboolean             save_results,
+								  gboolean             detailed);
+TrackerDBResultSet *tracker_db_search_text_and_mime              (TrackerDBInterface  *iface,
+								  const gchar         *text,
+								  gchar              **mime_array);
+TrackerDBResultSet *tracker_db_search_text_and_location          (TrackerDBInterface  *iface,
+								  const gchar         *text,
+								  const gchar         *location);
+TrackerDBResultSet *tracker_db_search_text_and_mime_and_location (TrackerDBInterface  *iface,
+								  const gchar         *text,
+								  gchar              **mime_array,
+								  const gchar         *location);
 
 /* Service API */
-guint32             tracker_db_service_create                  (TrackerDBInterface  *iface,
-								const gchar         *service,
-								TrackerDBFileInfo   *info);
-gchar *             tracker_db_service_get_by_entity           (TrackerDBInterface  *iface,
-								const gchar         *id);
+guint32             tracker_db_service_create                    (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  TrackerDBFileInfo   *info);
+gchar *             tracker_db_service_get_by_entity             (TrackerDBInterface  *iface,
+								  const gchar         *id);
 
 /* Files API */
-gchar **            tracker_db_files_get                       (TrackerDBInterface  *iface,
-								const gchar         *folder_uri);
-TrackerDBResultSet *tracker_db_files_get_by_service            (TrackerDBInterface  *iface,
-								const gchar         *service,
-								gint                 offset,
-								gint                 limit);
-TrackerDBResultSet *tracker_db_files_get_by_mime               (TrackerDBInterface  *iface,
-								gchar              **mimes,
-								gint                 n,
-								gint                 offset,
-								gint                 limit,
-								gboolean             vfs);
-guint32             tracker_db_file_get_id                     (TrackerDBInterface  *iface,
-								const gchar         *uri);
-gchar *             tracker_db_file_get_id_as_string           (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *uri);
-TrackerDBFileInfo * tracker_db_file_get_info                   (TrackerDBInterface  *iface,
-								TrackerDBFileInfo   *info);
-gboolean            tracker_db_file_is_up_to_date              (TrackerDBInterface  *iface,
-								const gchar         *uri,
-								guint32             *id);
-void                tracker_db_file_delete                     (TrackerDBInterface  *iface,
-								guint32              file_id);
-void                tracker_db_file_move                       (TrackerDBInterface  *iface,
-								const gchar         *moved_from_uri,
-								const gchar         *moved_to_uri);
-void                tracker_db_directory_delete                (TrackerDBInterface  *iface,
-								guint32              file_id,
-								const gchar         *uri);
-void                tracker_db_directory_move                  (TrackerDBInterface  *iface,
-								const gchar         *moved_from_uri,
-								const gchar         *moved_to_uri);
-void                tracker_db_uri_insert_pending              (const gchar         *id,
-								const gchar         *action,
-								const gchar         *counter,
-								const gchar         *uri,
-								const gchar         *mime,
-								gboolean             is_dir,
-								gboolean             is_new,
-								gint                 service_type_id);
-void                tracker_db_uri_update_pending              (const gchar         *counter,
-								const gchar         *action,
-								const gchar         *uri);
-TrackerDBResultSet *tracker_db_uri_get_subfolders              (TrackerDBInterface  *iface,
-								const gchar         *uri);
-TrackerDBResultSet *tracker_db_uri_sub_watches_get             (const gchar         *dir);
-TrackerDBResultSet *tracker_db_uri_sub_watches_delete          (const gchar         *dir);
+gchar **            tracker_db_files_get                         (TrackerDBInterface  *iface,
+								  const gchar         *folder_uri);
+TrackerDBResultSet *tracker_db_files_get_by_service              (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  gint                 offset,
+								  gint                 limit);
+TrackerDBResultSet *tracker_db_files_get_by_mime                 (TrackerDBInterface  *iface,
+								  gchar              **mimes,
+								  gint                 n,
+								  gint                 offset,
+								  gint                 limit,
+								  gboolean             vfs);
+guint32             tracker_db_file_get_id                       (TrackerDBInterface  *iface,
+								  const gchar         *uri);
+gchar *             tracker_db_file_get_id_as_string             (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *uri);
+TrackerDBFileInfo * tracker_db_file_get_info                     (TrackerDBInterface  *iface,
+								  TrackerDBFileInfo   *info);
+gboolean            tracker_db_file_is_up_to_date                (TrackerDBInterface  *iface,
+								  const gchar         *uri,
+								  guint32             *id);
+void                tracker_db_file_delete                       (TrackerDBInterface  *iface,
+								  guint32              file_id);
+void                tracker_db_file_move                         (TrackerDBInterface  *iface,
+								  const gchar         *moved_from_uri,
+								  const gchar         *moved_to_uri);
+void                tracker_db_directory_delete                  (TrackerDBInterface  *iface,
+								  guint32              file_id,
+								  const gchar         *uri);
+void                tracker_db_directory_move                    (TrackerDBInterface  *iface,
+								  const gchar         *moved_from_uri,
+								  const gchar         *moved_to_uri);
+void                tracker_db_uri_insert_pending                (const gchar         *id,
+								  const gchar         *action,
+								  const gchar         *counter,
+								  const gchar         *uri,
+								  const gchar         *mime,
+								  gboolean             is_dir,
+								  gboolean             is_new,
+								  gint                 service_type_id);
+void                tracker_db_uri_update_pending                (const gchar         *counter,
+								  const gchar         *action,
+								  const gchar         *uri);
+TrackerDBResultSet *tracker_db_uri_get_subfolders                (TrackerDBInterface  *iface,
+								  const gchar         *uri);
+TrackerDBResultSet *tracker_db_uri_sub_watches_get               (const gchar         *dir);
+TrackerDBResultSet *tracker_db_uri_sub_watches_delete            (const gchar         *dir);
 
 /* Keywords API */
-TrackerDBResultSet *tracker_db_keywords_get_list               (TrackerDBInterface  *iface,
-								const gchar         *service);
+TrackerDBResultSet *tracker_db_keywords_get_list                 (TrackerDBInterface  *iface,
+								  const gchar         *service);
 
 /* Miscellaneous API */
-GHashTable *        tracker_db_get_file_contents_words         (TrackerDBInterface  *iface,
-								guint32              id,
-								GHashTable          *old_table);
-GHashTable *        tracker_db_get_indexable_content_words     (TrackerDBInterface  *iface,
-								guint32              id,
-								GHashTable          *table,
-								gboolean             embedded_only);
-gchar *             tracker_db_get_field_name                  (const gchar         *service,
-								const gchar         *meta_name);
-TrackerFieldData *  tracker_db_get_metadata_field              (TrackerDBInterface  *iface,
-								const gchar         *service,
-								const gchar         *field_name,
-								gint                 field_count,
-								gboolean             is_select,
-								gboolean             is_condition);
+GHashTable *        tracker_db_get_file_contents_words           (TrackerDBInterface  *iface,
+								  guint32              id,
+								  GHashTable          *old_table);
+GHashTable *        tracker_db_get_indexable_content_words       (TrackerDBInterface  *iface,
+								  guint32              id,
+								  GHashTable          *table,
+								  gboolean             embedded_only);
+gchar *             tracker_db_get_field_name                    (const gchar         *service,
+								  const gchar         *meta_name);
+TrackerFieldData *  tracker_db_get_metadata_field                (TrackerDBInterface  *iface,
+								  const gchar         *service,
+								  const gchar         *field_name,
+								  gint                 field_count,
+								  gboolean             is_select,
+								  gboolean             is_condition);
 
 /* Live Search API */
-void                tracker_db_live_search_start               (TrackerDBInterface  *iface,
-								const gchar         *from_query,
-								const gchar         *join_query,
-								const gchar         *where_query,
-								const gchar         *search_id);
-void                tracker_db_live_search_stop                (TrackerDBInterface  *iface,
-								const gchar         *search_id);
-TrackerDBResultSet *tracker_db_live_search_get_all_ids         (TrackerDBInterface  *iface,
-								const gchar         *search_id);
-TrackerDBResultSet *tracker_db_live_search_get_new_ids         (TrackerDBInterface  *iface,
-								const gchar         *search_id,
-								const gchar         *from_query,
-								const gchar         *query_joins,
-								const gchar         *where_query);
-TrackerDBResultSet *tracker_db_live_search_get_deleted_ids     (TrackerDBInterface  *iface,
-								const gchar         *search_id);
-TrackerDBResultSet *tracker_db_live_search_get_hit_data        (TrackerDBInterface  *iface,
-								const gchar         *search_id,
-								GStrv                fields);
-TrackerDBResultSet *tracker_db_live_search_get_hit_count       (TrackerDBInterface  *iface,
-								const gchar         *search_id);
+void                tracker_db_live_search_start                 (TrackerDBInterface  *iface,
+								  const gchar         *from_query,
+								  const gchar         *join_query,
+								  const gchar         *where_query,
+								  const gchar         *search_id);
+void                tracker_db_live_search_stop                  (TrackerDBInterface  *iface,
+								  const gchar         *search_id);
+TrackerDBResultSet *tracker_db_live_search_get_all_ids           (TrackerDBInterface  *iface,
+								  const gchar         *search_id);
+TrackerDBResultSet *tracker_db_live_search_get_new_ids           (TrackerDBInterface  *iface,
+								  const gchar         *search_id,
+								  const gchar         *from_query,
+								  const gchar         *query_joins,
+								  const gchar         *where_query);
+TrackerDBResultSet *tracker_db_live_search_get_deleted_ids       (TrackerDBInterface  *iface,
+								  const gchar         *search_id);
+TrackerDBResultSet *tracker_db_live_search_get_hit_data          (TrackerDBInterface  *iface,
+								  const gchar         *search_id,
+								  GStrv                fields);
+TrackerDBResultSet *tracker_db_live_search_get_hit_count         (TrackerDBInterface  *iface,
+								  const gchar         *search_id);
 
 /* XESAM API */
-void                tracker_db_xesam_delete_handled_events     (TrackerDBInterface  *iface);
-TrackerDBResultSet *tracker_db_xesam_get_metadata_names        (TrackerDBInterface  *iface,
-								const char          *name);
-TrackerDBResultSet *tracker_db_xesam_get_service_names         (TrackerDBInterface  *iface,
-								const char          *name);
+void                tracker_db_xesam_delete_handled_events       (TrackerDBInterface  *iface);
+TrackerDBResultSet *tracker_db_xesam_get_metadata_names          (TrackerDBInterface  *iface,
+								  const char          *name);
+TrackerDBResultSet *tracker_db_xesam_get_service_names           (TrackerDBInterface  *iface,
+								  const char          *name);
 
 G_END_DECLS
 

Modified: branches/indexer-split/src/trackerd/tracker-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-files.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-files.c	Thu Jun 19 12:31:38 2008
@@ -889,3 +889,185 @@
 
         return TRUE;
 }
+
+gboolean
+tracker_files_search_by_text_and_mime (TrackerFiles   *object,
+				       const gchar    *text,
+				       gchar         **mime_types,
+				       gchar        ***values,
+				       GError        **error)
+{
+	TrackerDBInterface  *iface;
+	TrackerDBResultSet  *result_set;
+	guint                request_id;
+
+	request_id = tracker_dbus_get_next_request_id ();
+
+	tracker_dbus_return_val_if_fail (text != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (mime_types != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (g_strv_length (mime_types) > 0, FALSE, error);
+	tracker_dbus_return_val_if_fail (values != NULL, FALSE, error);
+
+	tracker_dbus_request_new (request_id,
+				  "DBus request to search files by text & mime types, "
+                                  "text:'%s', mime types:%d",
+                                  text,
+                                  g_strv_length (mime_types));
+
+	iface = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
+	result_set = tracker_db_search_text_and_mime (iface, text, mime_types);
+
+	if (result_set) {
+		gboolean  valid = TRUE;
+		gchar    *prefix, *name;
+		gint      row_count = 0;
+		gint      i = 0;
+
+		row_count = tracker_db_result_set_get_n_rows (result_set);
+		*values = g_new0 (gchar *, row_count);
+
+		while (valid) {
+			tracker_db_result_set_get (result_set,
+						   0, &prefix,
+						   1, &name,
+						   -1);
+
+			*values[i++] = g_build_filename (prefix, name, NULL);
+			valid = tracker_db_result_set_iter_next (result_set);
+
+			g_free (prefix);
+			g_free (name);
+		}
+
+		g_object_unref (result_set);
+	} else {
+		*values = g_new0 (gchar *, 1);
+		*values[0] = NULL;
+	}
+	
+        tracker_dbus_request_success (request_id);
+
+	return TRUE;
+}
+
+gboolean
+tracker_files_search_by_text_and_location (TrackerFiles   *object,
+					   const gchar    *text,
+					   const gchar    *uri,
+					   gchar        ***values,
+					   GError        **error)
+{
+	TrackerDBInterface *iface;
+	TrackerDBResultSet *result_set;
+	guint               request_id;
+
+	request_id = tracker_dbus_get_next_request_id ();
+
+	tracker_dbus_return_val_if_fail (text != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (uri != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (values != NULL, FALSE, error);
+
+	tracker_dbus_request_new (request_id,
+				  "DBus request to search files by text & location, "
+                                  "text:'%s', uri:'%s'",
+                                  text,
+                                  uri);
+
+	iface = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
+	result_set = tracker_db_search_text_and_location (iface, text, uri);
+
+	if (result_set) {
+		gboolean  valid = TRUE;
+		gchar    *prefix, *name;
+		gint      row_count;
+		gint      i = 0;
+
+		row_count = tracker_db_result_set_get_n_rows (result_set);
+		*values = g_new0 (gchar *, row_count);
+
+		while (valid) {
+			tracker_db_result_set_get (result_set,
+						   0, &prefix,
+						   1, &name,
+						   -1);
+
+			*values[i++] = g_build_filename (prefix, name, NULL);
+			valid = tracker_db_result_set_iter_next (result_set);
+
+			g_free (prefix);
+			g_free (name);
+		}
+
+		g_object_unref (result_set);
+	} else {
+		*values = g_new0 (gchar *, 1);
+		*values[0] = NULL;
+	}
+
+        tracker_dbus_request_success (request_id);
+
+	return TRUE;
+}
+
+gboolean
+tracker_files_search_by_text_and_mime_and_location (TrackerFiles   *object,
+						    const gchar    *text,
+						    gchar         **mime_types,
+						    const gchar    *uri,
+						    gchar        ***values,
+						    GError        **error)
+{
+	TrackerDBInterface *iface;
+	TrackerDBResultSet *result_set;
+	guint               request_id;
+
+	request_id = tracker_dbus_get_next_request_id ();
+
+	tracker_dbus_return_val_if_fail (text != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (mime_types != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (g_strv_length (mime_types) > 0, FALSE, error);
+	tracker_dbus_return_val_if_fail (uri != NULL, FALSE, error);
+	tracker_dbus_return_val_if_fail (values != NULL, FALSE, error);
+
+	tracker_dbus_request_new (request_id,
+				  "DBus request to search files by text & mime types & location, "
+                                  "text:'%s', mime types:%d, uri:'%s'",
+                                  text,
+				  g_strv_length (mime_types),
+                                  uri);
+
+	iface = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
+	result_set = tracker_db_search_text_and_mime_and_location (iface, text, mime_types, uri);
+
+	if (result_set) {
+		gboolean  valid = TRUE;
+		gchar    *prefix, *name;
+		gint      row_count;
+		gint      i = 0;
+
+		row_count = tracker_db_result_set_get_n_rows (result_set);
+		*values = g_new0 (gchar *, row_count);
+
+		while (valid) {
+			tracker_db_result_set_get (result_set,
+						   0, &prefix,
+						   1, &name,
+						   -1);
+
+			*values[i++] = g_build_filename (prefix, name, NULL);
+			valid = tracker_db_result_set_iter_next (result_set);
+
+			g_free (prefix);
+			g_free (name);
+		}
+
+		g_object_unref (result_set);
+	} else {
+		*values = g_new0 (gchar *, 1);
+		*values[0] = NULL;
+	}
+
+        tracker_dbus_request_success (request_id);
+
+	return TRUE;
+}

Modified: branches/indexer-split/src/trackerd/tracker-files.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-files.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-files.h	Thu Jun 19 12:31:38 2008
@@ -48,72 +48,88 @@
 	GObjectClass parent;
 };
 
-GType    tracker_files_get_type                         (void);
+GType    tracker_files_get_type                             (void);
 
 TrackerFiles *
-         tracker_files_new                              (void);
-gboolean tracker_files_exist                            (TrackerFiles   *object,
-							 const gchar    *uri,
-							 gboolean        auto_create,
-							 gboolean       *value,
-							 GError        **error);
-gboolean tracker_files_create                           (TrackerFiles   *object,
-							 const gchar    *uri,
-							 gboolean        is_directory,
-							 const gchar    *mime,
-							 gint            size,
-							 gint            mtime,
-							 GError        **error);
-gboolean tracker_files_delete                           (TrackerFiles   *object,
-							 const gchar    *uri,
-							 GError        **error);
-gboolean tracker_files_get_service_type                 (TrackerFiles   *object,
-							 const gchar    *uri,
-							 gchar         **value,
-							 GError        **error);
-gboolean tracker_files_get_text_contents                (TrackerFiles   *object,
-							 const gchar    *uri,
-							 gint            offset,
-							 gint            max_length,
-							 gchar         **value,
-							 GError        **error);
-gboolean tracker_files_search_text_contents             (TrackerFiles   *object,
-							 const gchar    *uri,
-							 const gchar    *text,
-							 gint            max_length,
-							 gchar         **value,
-							 GError        **error);
-gboolean tracker_files_get_by_service_type              (TrackerFiles   *object,
-							 gint            live_query_id,
-							 const gchar    *service,
-							 gint            offset,
-							 gint            max_hits,
-							 gchar        ***values,
-							 GError        **error);
-gboolean tracker_files_get_by_mime_type                 (TrackerFiles   *object,
-							 gint            live_query_id,
-							 gchar         **mime_types,
-							 gint            offset,
-							 gint            max_hits,
-							 gchar        ***values,
-							 GError        **error);
-gboolean tracker_files_get_by_mime_type_vfs             (TrackerFiles   *object,
-							 gint            live_query_id,
-							 gchar         **mime_types,
-							 gint            offset,
-							 gint            max_hits,
-							 gchar        ***values,
-							 GError        **error);
-gboolean tracker_files_get_mtime                        (TrackerFiles   *object,
-							 const gchar    *uri,
-							 gint           *value,
-							 GError        **error);
-gboolean tracker_files_get_metadata_for_files_in_folder (TrackerFiles   *object,
-							 gint            live_query_id,
-							 const gchar    *uri,
-							 gchar         **fields,
-							 GPtrArray     **values,
-							 GError        **error);
+         tracker_files_new                                  (void);
+gboolean tracker_files_exist                                (TrackerFiles   *object,
+							     const gchar    *uri,
+							     gboolean        auto_create,
+							     gboolean       *value,
+							     GError        **error);
+gboolean tracker_files_create                               (TrackerFiles   *object,
+							     const gchar    *uri,
+							     gboolean        is_directory,
+							     const gchar    *mime,
+							     gint            size,
+							     gint            mtime,
+							     GError        **error);
+gboolean tracker_files_delete                               (TrackerFiles   *object,
+							     const gchar    *uri,
+							     GError        **error);
+gboolean tracker_files_get_service_type                     (TrackerFiles   *object,
+							     const gchar    *uri,
+							     gchar         **value,
+							     GError        **error);
+gboolean tracker_files_get_text_contents                    (TrackerFiles   *object,
+							     const gchar    *uri,
+							     gint            offset,
+							     gint            max_length,
+							     gchar         **value,
+							     GError        **error);
+gboolean tracker_files_search_text_contents                 (TrackerFiles   *object,
+							     const gchar    *uri,
+							     const gchar    *text,
+							     gint            max_length,
+							     gchar         **value,
+							     GError        **error);
+gboolean tracker_files_get_by_service_type                  (TrackerFiles   *object,
+							     gint            live_query_id,
+							     const gchar    *service,
+							     gint            offset,
+							     gint            max_hits,
+							     gchar        ***values,
+							     GError        **error);
+gboolean tracker_files_get_by_mime_type                     (TrackerFiles   *object,
+							     gint            live_query_id,
+							     gchar         **mime_types,
+							     gint            offset,
+							     gint            max_hits,
+							     gchar        ***values,
+							     GError        **error);
+gboolean tracker_files_get_by_mime_type_vfs                 (TrackerFiles   *object,
+							     gint            live_query_id,
+							     gchar         **mime_types,
+							     gint            offset,
+							     gint            max_hits,
+							     gchar        ***values,
+							     GError        **error);
+gboolean tracker_files_get_mtime                            (TrackerFiles   *object,
+							     const gchar    *uri,
+							     gint           *value,
+							     GError        **error);
+gboolean tracker_files_get_metadata_for_files_in_folder     (TrackerFiles   *object,
+							     gint            live_query_id,
+							     const gchar    *uri,
+							     gchar         **fields,
+							     GPtrArray     **values,
+							     GError        **error);
+gboolean tracker_files_search_by_text_and_mime              (TrackerFiles   *object,
+							     const gchar    *text,
+							     gchar         **mime_types,
+							     gchar        ***values,
+							     GError        **error);
+gboolean tracker_files_search_by_text_and_location          (TrackerFiles   *object,
+							     const gchar    *text,
+							     const gchar    *uri,
+							     gchar        ***values,
+							     GError        **error);
+gboolean tracker_files_search_by_text_and_mime_and_location (TrackerFiles   *object,
+							     const gchar    *text,
+							     gchar         **mime_types,
+							     const gchar    *uri,
+							     gchar        ***values,
+							     GError        **error);
 
 G_END_DECLS
 

Modified: branches/indexer-split/src/trackerd/tracker-metadata.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-metadata.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-metadata.c	Thu Jun 19 12:31:38 2008
@@ -285,73 +285,6 @@
 }
 
 gboolean
-tracker_metadata_register_type (TrackerMetadata  *object,
-				const gchar      *metadata,
-				const gchar      *type,
-				GError          **error)
-{
-	TrackerDBInterface *iface;
-	TrackerDBResultSet *result_set;
-	guint               request_id;
-	const gchar        *type_id;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_return_val_if_fail (metadata != NULL, FALSE, error);
-	tracker_dbus_return_val_if_fail (type != NULL, FALSE, error);
-	
-	tracker_dbus_request_new (request_id,
-				  "DBus request to register metadata type, "
-				  "type:'%s', name:'%s'",
-				  type,
-				  metadata);
-
-	if (!metadata || strlen (metadata) < 3 || strchr (metadata, ':') == NULL) {
-		tracker_dbus_request_failed (request_id,
-					     error, 
-					     "Metadata name '%s' is invalid, all names must be in "
-					     "the format 'class:name'", 
-					     metadata);
-		return FALSE;
-	}
-
-	if (strcmp (type, "index") == 0) {
-		type_id = "0";
-	} else if (strcmp (type, "string") == 0) {
-		type_id = "1";
-	} else if (strcmp (type, "numeric") == 0) {
-		type_id = "2";
-	} else if (strcmp (type, "date") == 0) {
-		type_id = "3";
-	} else {
-		tracker_dbus_request_failed (request_id, 
-					     error, 
-					     "Metadata type '%s' is invalid, types include 'index', "
-					     "'string', 'numeric' and 'date'", 
-					     metadata);
-		return FALSE;
-	}
-
-	iface = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
-
-	result_set = tracker_db_exec_proc (iface, 
-					   "InsertMetadataType", 
-					   4, 
-					   metadata, 
-					   type_id, 
-					   "0", 
-					   "1");
-
-	if (result_set) {
-		g_object_unref (result_set);
-	}
-
-	tracker_dbus_request_success (request_id);
-
-	return TRUE;
-}
-
-gboolean
 tracker_metadata_get_type_details (TrackerMetadata  *object,
 				   const gchar      *metadata,
 				   gchar           **type,
@@ -439,45 +372,6 @@
 }
 
 gboolean
-tracker_metadata_get_writable_types (TrackerMetadata   *object,
-				     const gchar       *class,
-				     gchar           ***values,
-				     GError           **error)
-{
-	TrackerDBInterface *iface;
-	TrackerDBResultSet *result_set;
-	guint               request_id;
-	gchar              *class_formatted;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_return_val_if_fail (class != NULL, FALSE, error);
-	tracker_dbus_return_val_if_fail (values != NULL, FALSE, error);
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to get writable metadata types, "
-				  "class:'%s'",
-				  class);
-
-	iface = tracker_db_manager_get_db_interface (TRACKER_DB_FILE_METADATA);
-
-	class_formatted = g_strconcat (class, ".*", NULL);
-	result_set = tracker_db_metadata_get_types (iface, 
-						    class_formatted, 
-						    TRUE);
-	if (result_set) {
-		*values = tracker_dbus_query_result_to_strv (result_set, 0, NULL);
-		g_object_unref (result_set);
-	}
-
-	g_free (class_formatted);
-
-	tracker_dbus_request_success (request_id);
-	
-	return TRUE;
-}
-
-gboolean
 tracker_metadata_get_registered_classes (TrackerMetadata   *object,
 					 gchar           ***values,
 					 GError           **error)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]