summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-12-21 11:04:18 +0000
committerOndrej Holy <oholy@redhat.com>2020-12-22 09:48:44 +0000
commit6f3b7f8b005a36c2be43673f4c933f7ae71d95c8 (patch)
treea7055bf0a0c7412d1315aecdff6a6dfd66881765 /src
parentdab88ac58def127ad9eaecd21075db2bcdc1ae7b (diff)
downloadnautilus-6f3b7f8b005a36c2be43673f4c933f7ae71d95c8.tar.gz
Revert "search: Remove special characters from FTS searches"
This reverts commit e3031953e40b4fe067d566ac6c403127d7b6c266 It worked around an issue in tracker, which is fixed now: https://gitlab.gnome.org/GNOME/tracker/-/issues/252
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-search-engine-tracker.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 9ebac0b28..6ba9446a6 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -294,31 +294,6 @@ search_finished_idle (gpointer user_data)
*/
#define FILENAME_RANK "5.0"
-static gchar *
-filter_alnum_strdup (gchar *string)
-{
- GString *filtered;
- gchar *c;
-
- filtered = g_string_new ("");
- for (c = string; *c; c = g_utf8_next_char (c))
- {
- gunichar uc;
-
- uc = g_utf8_get_char (c);
- if (g_unichar_isalnum (uc))
- {
- g_string_append_unichar (filtered, uc);
- }
- else
- {
- g_string_append_c (filtered, ' ');
- }
- }
-
- return g_string_free (filtered, FALSE);
-}
-
static void
nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
{
@@ -396,16 +371,13 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
if (tracker->fts_enabled && *search_text)
{
/* Use fts:match only for content search to not lose some filename results due to stop words. */
- g_autofree gchar *filtered_search_text;
-
- filtered_search_text = filter_alnum_strdup (search_text);
g_string_append_printf (sparql,
" { "
" ?content nie:isStoredAs ?file ."
" ?content fts:match \"%s*\" ."
" BIND(fts:rank(?content) AS ?rank1) ."
" } UNION",
- filtered_search_text);
+ search_text);
}
g_string_append_printf (sparql,