[tracker] libtracker-miner: group elements on tracker_decorator_next() query



commit 1e846a13f39189c7244f6d203c561eb97e868dac
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 2c171a38a..ba8b335b3 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]