[tracker-miners/wip/carlosg/tracker-3.0-api-breaks: 39/40] tracker-miner-rss: Hook up FTS configuration
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/tracker-3.0-api-breaks: 39/40] tracker-miner-rss: Hook up FTS configuration
- Date: Mon, 17 Feb 2020 12:27:40 +0000 (UTC)
commit 1f6146a8cd545a91229b7eb6b2a1e1b2ba084134
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Feb 12 14:47:54 2020 +0100
tracker-miner-rss: Hook up FTS configuration
src/miners/rss/tracker-main.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/src/miners/rss/tracker-main.c b/src/miners/rss/tracker-main.c
index c13d716bd..b78f0303b 100644
--- a/src/miners/rss/tracker-main.c
+++ b/src/miners/rss/tracker-main.c
@@ -68,6 +68,28 @@ on_domain_vanished (GDBusConnection *connection,
g_main_loop_quit (loop);
}
+TrackerSparqlConnectionFlags
+get_fts_connection_flags (void)
+{
+ TrackerSparqlConnectionFlags flags = 0;
+ TrackerFTSConfig *fts_config;
+
+ fts_config = tracker_fts_config_new ();
+
+ if (tracker_fts_config_get_enable_stemmer (fts_config))
+ flags |= TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STEMMER;
+ if (tracker_fts_config_get_enable_unaccent (fts_config))
+ flags |= TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT;
+ if (tracker_fts_config_get_ignore_numbers (fts_config))
+ flags |= TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS;
+ if (tracker_fts_config_get_ignore_stop_words (fts_config))
+ flags |= TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS;
+
+ g_object_unref (fts_config);
+
+ return flags;
+}
+
static gboolean
setup_connection_and_endpoint (TrackerDomainOntology *domain,
GDBusConnection *connection,
@@ -78,7 +100,7 @@ setup_connection_and_endpoint (TrackerDomainOntology *domain,
GFile *store;
store = tracker_domain_ontology_get_cache (domain);
- *sparql_conn = tracker_sparql_connection_new (TRACKER_SPARQL_CONNECTION_FLAGS_NONE,
+ *sparql_conn = tracker_sparql_connection_new (get_fts_connection_flags (),
store,
NULL,
NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]