[nautilus/wip/antoniof/tag-manager-cleanup: 2/3] Revert "search: Remove special characters from FTS searches"
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/tag-manager-cleanup: 2/3] Revert "search: Remove special characters from FTS searches"
- Date: Mon, 21 Dec 2020 12:57:00 +0000 (UTC)
commit 0296c0b412326cde480fe1d982e0e6c63561ed48
Author: António Fernandes <antoniof gnome org>
Date: Mon Dec 21 11:04:18 2020 +0000
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
src/nautilus-search-engine-tracker.c | 30 +-----------------------------
1 file changed, 1 insertion(+), 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]