[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 81/116] libtracker-miner: group elements on tracker_decorator_next() query



commit 9bcf0ac4dfc7534ecdd3e4384bb6d19ec7adcfd9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Sep 9 12:18:14 2018 +0200

    libtracker-miner: group elements on tracker_decorator_next() query
    
    This query would deduplicate files by their matching rdf:types, which
    may possibly return the same file multiple types if the file as
    several types that satisfy the query. Group by the URN so we only get
    each element exactly once.

 src/libtracker-miner/tracker-decorator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-decorator.c b/src/libtracker-miner/tracker-decorator.c
index 2ec396d59..e8948f79f 100644
--- a/src/libtracker-miner/tracker-decorator.c
+++ b/src/libtracker-miner/tracker-decorator.c
@@ -758,7 +758,7 @@ create_query_string (TrackerDecorator  *decorator,
                prev = cur;
        }
 
-       g_string_append_printf (query, "))}}} LIMIT %d", QUERY_BATCH_SIZE);
+       g_string_append_printf (query, "))}} GROUP BY ?urn } LIMIT %d", QUERY_BATCH_SIZE);
 
        return g_string_free (query, FALSE);
 }


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