]> arthur.barton.de Git - netatalk.git/commitdiff
Spotlight: SPARQL query optimisation
authorRalph Boehme <rb@sernet.de>
Tue, 3 Jun 2014 07:41:25 +0000 (09:41 +0200)
committerRalph Boehme <rb@sernet.de>
Tue, 3 Jun 2014 07:41:25 +0000 (09:41 +0200)
Avoid DISTINCT in SPARQL queries and add a LIMIT which is arbitrarily
set to 100 for now.

Signed-off-by: Ralph Boehme <rb@sernet.de>
etc/spotlight/slmod_sparql_parser.y

index 68d3d1013afd36fe2ed625ba1d764b737a4e1ed7..be0b9034d47a6aa7a7d41181191525bf6cac9230 100644 (file)
@@ -72,8 +72,8 @@ input:
 line:
 expr                           {
     ssp_result = talloc_asprintf(ssp_slq,
-                                 "SELECT DISTINCT ?url WHERE "
-                                 "{ ?obj nie:url ?url FILTER(regex(?url, '^file://%s/')) . %s}",
+                                 "SELECT ?url WHERE "
+                                 "{ ?obj nie:url ?url FILTER(regex(?url, '^file://%s/')) . %s} LIMIT 100",
                                  ssp_slq->slq_vol->v_path, $1);
     $$ = ssp_result;
 }