[tracker/tracker-0.14] tracker-needle: Find documents (e.g. PDFs) when searching for creators/publishers
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.14] tracker-needle: Find documents (e.g. PDFs) when searching for creators/publishers
- Date: Wed, 6 Feb 2013 14:51:01 +0000 (UTC)
commit 8162ab632846f9de434aaf85eecef5278fdb5119
Author: Martyn Russell <martyn lanedo com>
Date: Fri Feb 1 14:29:24 2013 +0000
tracker-needle: Find documents (e.g. PDFs) when searching for creators/publishers
Fixes GB#692603, Search can not find pdf files using author names
src/tracker-needle/tracker-needle.vala | 2 +-
src/tracker-needle/tracker-query.vala | 23 ++++++++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 5cd6cc4..efcb4e1 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -110,7 +110,7 @@ public class Tracker.Needle {
"nfo:duration(?urn)",
"nie:url(?urn)");
categories_model.add_query (Tracker.Query.Type.DOCUMENTS,
- Tracker.Query.Match.FTS,
+ Tracker.Query.Match.FTS_INDIRECT,
"?urn",
"nie:url(?urn)",
"tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))",
diff --git a/src/tracker-needle/tracker-query.vala b/src/tracker-needle/tracker-query.vala
index 6e2e73f..77d7823 100644
--- a/src/tracker-needle/tracker-query.vala
+++ b/src/tracker-needle/tracker-query.vala
@@ -129,9 +129,17 @@ public class Tracker.Query {
// DOCUMENTS
"WHERE {
- ?urn a nfo:Document ;
- nie:url ?tooltip .
- %s
+ {
+ ?urn nco:creator ?match
+ } UNION {
+ ?urn nco:publisher ?match
+ } UNION {
+ ?urn a nfo:Document .
+ ?match a nfo:Document
+ FILTER (?urn = ?match)
+ }
+ %s .
+ ?urn nie:url ?tooltip .
OPTIONAL {
?urn nco:creator ?creator .
}
@@ -252,10 +260,11 @@ public class Tracker.Query {
return false;
}
- if (query_type != Type.MUSIC && !(match_type == Match.NONE ||
- match_type == Match.FTS ||
- match_type == Match.TITLES)) {
- critical ("You can not use a non-MUSIC query (%d) with INDIRECT matching (%d)", query_type, match_type);
+ if ((query_type != Type.MUSIC && query_type != Type.DOCUMENTS) &&
+ !(match_type == Match.NONE ||
+ match_type == Match.FTS ||
+ match_type == Match.TITLES)) {
+ critical ("You can not use a non-MUSIC or non-DOCUMENTS query (%d) with INDIRECT matching (%d)", query_type, match_type);
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]