tracker r2600 - in branches/turtle: . src/libtracker-data
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2600 - in branches/turtle: . src/libtracker-data
- Date: Thu, 27 Nov 2008 15:02:44 +0000 (UTC)
Author: pvanhoof
Date: Thu Nov 27 15:02:44 2008
New Revision: 2600
URL: http://svn.gnome.org/viewvc/tracker?rev=2600&view=rev
Log:
2008-11-27 Philip Van Hoof <philip codeminded be>
* src/libtracker-data/tracker-data-update.c: Mimicking what(ever)
index_metadata_item is doing to store metadata (also to cope with
list values)
Modified:
branches/turtle/ChangeLog
branches/turtle/src/libtracker-data/tracker-data-update.c
Modified: branches/turtle/src/libtracker-data/tracker-data-update.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-data-update.c (original)
+++ branches/turtle/src/libtracker-data/tracker-data-update.c Thu Nov 27 15:02:44 2008
@@ -26,6 +26,7 @@
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-db/tracker-db-index-manager.h>
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-dbus.h>
@@ -606,7 +607,12 @@
static void
set_metadata (TrackerField *field, gpointer value, ForeachInMetadataInfo *info)
{
+ TrackerDBIndex *index;
gchar *parsed_value;
+ gchar **arr;
+ gint service_id;
+ gint i;
+ gint score;
/* TODO untested and unfinished port that came from the decomposed
* branch of JÃrg. When merging from the decomposed branch to trunk
@@ -624,9 +630,25 @@
return;
}
+ score = tracker_field_get_weight (field);
+
+ arr = g_strsplit (parsed_value, " ", -1);
+ service_id = tracker_service_get_id (info->service);
+ index = tracker_db_index_manager_get_index_by_service_id (service_id);
+
+ for (i = 0; arr[i]; i++) {
+ tracker_db_index_add_word (index,
+ arr[i],
+ info->iid_value,
+ tracker_service_get_id (info->service),
+ score);
+ }
+
tracker_data_update_set_metadata (info->service, info->iid_value, field, value, parsed_value);
g_free (parsed_value);
+ g_strfreev (arr);
+
}
static void
@@ -636,6 +658,13 @@
{
ForeachInMetadataInfo *info = user_data;
gchar *parsed_value;
+ gint throttle;
+
+ /* Throttle indexer, value 9 is from older code, why 9? */
+ throttle = tracker_config_get_throttle (info->config);
+ if (throttle > 9) {
+ tracker_throttle (info->config, throttle * 100);
+ }
if (!tracker_field_get_multiple_values (field)) {
set_metadata (field, value, user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]