[tracker/fts4-fixes: 2/4] fts: Remove min/max word length limits from configuration



commit a9bad960f3c805eef290f64992cc540c702d65f6
Author: Carlos Garnacho <carlos lanedo com>
Date:   Thu Feb 14 17:47:33 2013 +0100

    fts: Remove min/max word length limits from configuration
    
    These aren't used anymore, so remove the dangling settings.

 .../org.freedesktop.Tracker.FTS.gschema.xml.in     |   14 ----
 src/libtracker-fts/tracker-fts-config.c            |   74 --------------------
 src/libtracker-fts/tracker-fts-config.h            |    6 --
 3 files changed, 0 insertions(+), 94 deletions(-)
---
diff --git a/data/gschemas/org.freedesktop.Tracker.FTS.gschema.xml.in 
b/data/gschemas/org.freedesktop.Tracker.FTS.gschema.xml.in
index c70f12b..25d31f4 100644
--- a/data/gschemas/org.freedesktop.Tracker.FTS.gschema.xml.in
+++ b/data/gschemas/org.freedesktop.Tracker.FTS.gschema.xml.in
@@ -20,20 +20,6 @@ Boston, MA  02110-1301, USA.
 <schemalist>
   <schema id="org.freedesktop.Tracker.FTS" path="/org/freedesktop/tracker/fts/">
 
-    <key name="min-word-length" type="i">
-      <default>3</default>
-      <range min="0" max="30"/>
-      <_summary>Minimum length of a word to be indexed</_summary>
-      <_description>Words with less characters than this will be ignored by the indexer.</_description>
-    </key>
-
-    <key name="max-word-length" type="i">
-      <default>30</default>
-      <range min="0" max="200"/>
-      <_summary>Maximum length of a word to be indexed</_summary>
-      <_description>Words with more characters than this length will be ignored by the 
indexer.</_description>
-    </key>
-
     <key name="max-words-to-index" type="i">
       <default>10000</default>
       <_summary>Maximum number of words to index in a document</_summary>
diff --git a/src/libtracker-fts/tracker-fts-config.c b/src/libtracker-fts/tracker-fts-config.c
index adce3d3..c5cd9b9 100644
--- a/src/libtracker-fts/tracker-fts-config.c
+++ b/src/libtracker-fts/tracker-fts-config.c
@@ -33,8 +33,6 @@
 #define GROUP_INDEXING             "Indexing"
 
 /* Default values */
-#define DEFAULT_MIN_WORD_LENGTH      3      /* 0->30 */
-#define DEFAULT_MAX_WORD_LENGTH      30     /* 0->200 */
 #define DEFAULT_MAX_WORDS_TO_INDEX   10000
 #define DEFAULT_IGNORE_NUMBERS       TRUE
 #define DEFAULT_IGNORE_STOP_WORDS    TRUE
@@ -56,8 +54,6 @@ enum {
        PROP_0,
 
        /* Indexing */
-       PROP_MIN_WORD_LENGTH,
-       PROP_MAX_WORD_LENGTH,
        PROP_ENABLE_STEMMER,
        PROP_ENABLE_UNACCENT,
        PROP_IGNORE_NUMBERS,
@@ -68,8 +64,6 @@ enum {
 };
 
 static TrackerConfigMigrationEntry migration[] = {
-       { G_TYPE_INT,     GROUP_INDEXING, "MinWordLength",   "min-word-length"    },
-       { G_TYPE_INT,     GROUP_INDEXING, "MaxWordLength",   "max-word-length"    },
        { G_TYPE_BOOLEAN, GROUP_INDEXING, "EnableStemmer" ,  "enable-stemmer"     },
        { G_TYPE_BOOLEAN, GROUP_INDEXING, "EnableUnaccent",  "enable-unaccent"    },
        { G_TYPE_BOOLEAN, GROUP_INDEXING, "IgnoreNumbers",   "ignore-numbers"     },
@@ -91,24 +85,6 @@ tracker_fts_config_class_init (TrackerFTSConfigClass *klass)
 
        /* Indexing */
        g_object_class_install_property (object_class,
-                                        PROP_MIN_WORD_LENGTH,
-                                        g_param_spec_int ("min-word-length",
-                                                          "Minimum word length",
-                                                          " Set the minimum length of words to index (0->30, 
default=3)",
-                                                          0,
-                                                          30,
-                                                          DEFAULT_MIN_WORD_LENGTH,
-                                                          G_PARAM_READWRITE));
-       g_object_class_install_property (object_class,
-                                        PROP_MAX_WORD_LENGTH,
-                                        g_param_spec_int ("max-word-length",
-                                                          "Maximum word length",
-                                                          " Set the maximum length of words to index 
(0->200, default=30)",
-                                                          0,
-                                                          200, /* Is this a reasonable limit? */
-                                                          DEFAULT_MAX_WORD_LENGTH,
-                                                          G_PARAM_READWRITE));
-       g_object_class_install_property (object_class,
                                         PROP_ENABLE_STEMMER,
                                         g_param_spec_boolean ("enable-stemmer",
                                                               "Enable Stemmer",
@@ -161,14 +137,6 @@ config_set_property (GObject      *object,
 {
        switch (param_id) {
                /* Indexing */
-       case PROP_MIN_WORD_LENGTH:
-               tracker_fts_config_set_min_word_length (TRACKER_FTS_CONFIG (object),
-                                                       g_value_get_int (value));
-               break;
-       case PROP_MAX_WORD_LENGTH:
-               tracker_fts_config_set_max_word_length (TRACKER_FTS_CONFIG (object),
-                                                       g_value_get_int (value));
-               break;
        case PROP_ENABLE_STEMMER:
                tracker_fts_config_set_enable_stemmer (TRACKER_FTS_CONFIG (object),
                                                       g_value_get_boolean (value));
@@ -206,12 +174,6 @@ config_get_property (GObject    *object,
 
        switch (param_id) {
                /* Indexing */
-       case PROP_MIN_WORD_LENGTH:
-               g_value_set_int (value, tracker_fts_config_get_min_word_length (config));
-               break;
-       case PROP_MAX_WORD_LENGTH:
-               g_value_set_int (value, tracker_fts_config_get_max_word_length (config));
-               break;
        case PROP_ENABLE_STEMMER:
                g_value_set_boolean (value, tracker_fts_config_get_enable_stemmer (config));
                break;
@@ -280,22 +242,6 @@ tracker_fts_config_save (TrackerFTSConfig *config)
        return TRUE;
 }
 
-gint
-tracker_fts_config_get_min_word_length (TrackerFTSConfig *config)
-{
-       g_return_val_if_fail (TRACKER_IS_FTS_CONFIG (config), DEFAULT_MIN_WORD_LENGTH);
-
-       return g_settings_get_int (G_SETTINGS (config), "min-word-length");
-}
-
-gint
-tracker_fts_config_get_max_word_length (TrackerFTSConfig *config)
-{
-       g_return_val_if_fail (TRACKER_IS_FTS_CONFIG (config), DEFAULT_MAX_WORD_LENGTH);
-
-       return g_settings_get_int (G_SETTINGS (config), "max-word-length");
-}
-
 gboolean
 tracker_fts_config_get_enable_stemmer (TrackerFTSConfig *config)
 {
@@ -337,26 +283,6 @@ tracker_fts_config_get_max_words_to_index (TrackerFTSConfig *config)
 }
 
 void
-tracker_fts_config_set_min_word_length (TrackerFTSConfig *config,
-                                        gint              value)
-{
-       g_return_if_fail (TRACKER_IS_FTS_CONFIG (config));
-
-        g_settings_set_int (G_SETTINGS (config), "min-word-length", value);
-       g_object_notify (G_OBJECT (config), "min-word-length");
-}
-
-void
-tracker_fts_config_set_max_word_length (TrackerFTSConfig *config,
-                                        gint              value)
-{
-       g_return_if_fail (TRACKER_IS_FTS_CONFIG (config));
-
-        g_settings_set_int (G_SETTINGS (config), "max-word-length", value);
-       g_object_notify (G_OBJECT (config), "max-word-length");
-}
-
-void
 tracker_fts_config_set_enable_stemmer (TrackerFTSConfig *config,
                                        gboolean          value)
 {
diff --git a/src/libtracker-fts/tracker-fts-config.h b/src/libtracker-fts/tracker-fts-config.h
index a3e4a86..1eb89f8 100644
--- a/src/libtracker-fts/tracker-fts-config.h
+++ b/src/libtracker-fts/tracker-fts-config.h
@@ -48,17 +48,11 @@ GType             tracker_fts_config_get_type               (void) G_GNUC_CONST;
 
 TrackerFTSConfig *tracker_fts_config_new                    (void);
 gboolean          tracker_fts_config_save                   (TrackerFTSConfig *config);
-gint              tracker_fts_config_get_min_word_length    (TrackerFTSConfig *config);
-gint              tracker_fts_config_get_max_word_length    (TrackerFTSConfig *config);
 gboolean          tracker_fts_config_get_enable_stemmer     (TrackerFTSConfig *config);
 gboolean          tracker_fts_config_get_enable_unaccent    (TrackerFTSConfig *config);
 gboolean          tracker_fts_config_get_ignore_numbers     (TrackerFTSConfig *config);
 gboolean          tracker_fts_config_get_ignore_stop_words  (TrackerFTSConfig *config);
 gint              tracker_fts_config_get_max_words_to_index (TrackerFTSConfig *config);
-void              tracker_fts_config_set_min_word_length    (TrackerFTSConfig *config,
-                                                             gint              value);
-void              tracker_fts_config_set_max_word_length    (TrackerFTSConfig *config,
-                                                             gint              value);
 void              tracker_fts_config_set_enable_stemmer     (TrackerFTSConfig *config,
                                                              gboolean          value);
 void              tracker_fts_config_set_enable_unaccent    (TrackerFTSConfig *config,


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