tracker r2962 - in trunk: . src/libtracker-db
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2962 - in trunk: . src/libtracker-db
- Date: Tue, 24 Feb 2009 16:51:44 +0000 (UTC)
Author: carlosg
Date: Tue Feb 24 16:51:43 2009
New Revision: 2962
URL: http://svn.gnome.org/viewvc/tracker?rev=2962&view=rev
Log:
2009-02-24 Carlos Garnacho <carlos imendio com>
* src/libtracker-db/tracker-db-index.c (tracker_db_index_add_word): Do
not remove words with negative weight from the cache, so they make it
to the actual index.
Modified:
trunk/ChangeLog
trunk/src/libtracker-db/tracker-db-index.c
Modified: trunk/src/libtracker-db/tracker-db-index.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-index.c (original)
+++ trunk/src/libtracker-db/tracker-db-index.c Tue Feb 24 16:51:43 2009
@@ -1071,25 +1071,15 @@
current = &g_array_index (array, TrackerDBIndexItem, i);
if (current->id == service_id) {
+ guint32 serv_type;
+
/* The word was already found in the same
- * service_id (file), increase score
+ * service_id (file), modify score
*/
new_score = tracker_db_index_item_get_score (current) + weight;
- if (new_score < 1) {
- array = g_array_remove_index (array, i);
- if (array->len == 0) {
- g_hash_table_remove (priv->cache, word);
- }
- } else {
- guint32 serv_type;
-
- serv_type =
- tracker_db_index_item_get_service_type (current);
- current->amalgamated =
- tracker_db_index_item_calc_amalgamated (serv_type,
- new_score);
- }
+ serv_type = tracker_db_index_item_get_service_type (current);
+ current->amalgamated = tracker_db_index_item_calc_amalgamated (serv_type, new_score);
return;
}
@@ -1097,7 +1087,6 @@
/* First time in the file */
g_array_append_val (array, elem);
-
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]