]> arthur.barton.de Git - netatalk.git/commitdiff
Spotlight: SPARQL query optimisations
authorRalph Boehme <rb@sernet.de>
Wed, 4 Jun 2014 10:11:40 +0000 (12:11 +0200)
committerRalph Boehme <rb@sernet.de>
Wed, 4 Jun 2014 10:11:40 +0000 (12:11 +0200)
Use tracker:uri-is-descendant FILTER instead of regex for filtering
results on the base path of the volume.

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

diff --git a/NEWS b/NEWS
index 6cdb7df2860e86c033700b70ab2f6a1d1baeb228..f9c9052f4c527db3303bf1e9d33b3c8e65a72007 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Changes in 3.1.3
+================
+* UPD: Spotlight: more SPARQL query optimisations
+
 Changes in 3.1.2
 ================
 * FIX: Option "vol dbpath" was broken in 3.1.1
index bb06ba7a66d9feb172c739018f48a5a56bfb05b8..f70d9ef100cbc1630202a2d6276885ca5d9e1543 100644 (file)
@@ -1450,8 +1450,8 @@ yyreduce:
     {
     ssp_result = talloc_asprintf(ssp_slq,
                                  "SELECT ?url WHERE "
-                                 "{ ?obj nie:url ?url FILTER(regex(?url, '^file://%s/')) . %s} LIMIT 100",
-                                 ssp_slq->slq_vol->v_path, (yyvsp[(1) - (1)].sval));
+                                 "{ %s . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file://%s/', ?url)) } LIMIT 100",
+                                 (yyvsp[(1) - (1)].sval), ssp_slq->slq_vol->v_path);
     (yyval.sval) = ssp_result;
 }
     break;
index be0b9034d47a6aa7a7d41181191525bf6cac9230..0763b39c913a08e89131440c0f7c486ab213a0bf 100644 (file)
@@ -73,8 +73,8 @@ line:
 expr                           {
     ssp_result = talloc_asprintf(ssp_slq,
                                  "SELECT ?url WHERE "
-                                 "{ ?obj nie:url ?url FILTER(regex(?url, '^file://%s/')) . %s} LIMIT 100",
-                                 ssp_slq->slq_vol->v_path, $1);
+                                 "{ %s . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file://%s/', ?url)) } LIMIT 100",
+                                 $1, ssp_slq->slq_vol->v_path);
     $$ = ssp_result;
 }
 ;