[tracker-miners/wip/carlosg/parallel-installable: 11/19] tracker: Drop HAVE_TRACKER_FTS define usage in "tracker search" CLI command
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/parallel-installable: 11/19] tracker: Drop HAVE_TRACKER_FTS define usage in "tracker search" CLI command
- Date: Mon, 6 Apr 2020 15:48:03 +0000 (UTC)
commit 3cee3b6813ece10bf255534507a31f445ac153b3
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Feb 24 01:30:37 2020 +0100
tracker: Drop HAVE_TRACKER_FTS define usage in "tracker search" CLI command
This is not defined properly for the tracker-miners repo. Instead make it
generic, and rely on --disable-fts being passed to the command line tool.
Also drop the stop words check as is a bit of a layering break that is no
longer possible with miner-related CLI commands living in tracker-miners.
src/tracker/tracker-search.c | 48 --------------------------------------------
1 file changed, 48 deletions(-)
---
diff --git a/src/tracker/tracker-search.c b/src/tracker/tracker-search.c
index 7312aa74d..4e1a3084c 100644
--- a/src/tracker/tracker-search.c
+++ b/src/tracker/tracker-search.c
@@ -1515,54 +1515,6 @@ search_run (void)
disable_snippets = TRUE;
}
- /* Only check stopwords if FTS is enabled */
- if (terms) {
- TrackerLanguage *language;
- gboolean stop_words_found;
- gchar **p;
-
- /* Check terms don't have additional quotes */
- for (p = terms; *p; p++) {
- gchar *term = *p;
- gint end = strlen (term) - 1;
-
- if ((term[0] == '"' && term[end] == '"') ||
- (term[0] == '\'' && term[end] == '\'')) {
- /* We never have a quote JUST at the end */
- term[0] = term[end] = ' ';
- g_strstrip (term);
- }
- }
-
- /* Check if terms are stopwords, and warn if so */
- language = tracker_language_new (NULL);
- stop_words_found = FALSE;
- for (p = terms; *p; p++) {
- gchar *down;
-
- down = g_utf8_strdown (*p, -1);
-
- if (tracker_language_is_stop_word (language, down)) {
- g_printerr (_("Search term ā%sā is a stop word."),
- down);
- g_printerr ("\n");
-
- stop_words_found = TRUE;
- }
-
- g_free (down);
- }
-
- if (stop_words_found) {
- g_printerr (_("Stop words are common words which "
- "may be ignored during the indexing "
- "process."));
- g_printerr ("\n\n");
- }
-
- g_object_unref (language);
- }
-
connection = tracker_sparql_connection_bus_new ("org.freedesktop.Tracker3.Miner.Files",
NULL, NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]