summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tissue/issue.scm15
-rw-r--r--tissue/search.scm8
2 files changed, 14 insertions, 9 deletions
diff --git a/tissue/issue.scm b/tissue/issue.scm
index d5d89bd..c9243ff 100644
--- a/tissue/issue.scm
+++ b/tissue/issue.scm
@@ -62,16 +62,21 @@
(define-method (document-boolean-terms (issue <issue>))
"Return the boolean terms in ISSUE."
- (append (list (string-append "A" (file-document-creator issue))
- (string-append "XA" (file-document-last-updater issue))
- (string-append "XS" (if (issue-open? issue)
+ (append (list (string-append "XS" (if (issue-open? issue)
"open" "closed")))
- (map (cut string-append "XI" <>)
- (issue-assigned issue))
(map (cut string-append "K" <>)
(issue-keywords issue))
(next-method)))
+(define-method (document-term-generator (issue <issue>))
+ "Return a term generator indexing ISSUE."
+ (let ((term-generator (next-method)))
+ (index-text! term-generator (file-document-creator issue) #:prefix "A")
+ (index-text! term-generator (file-document-last-updater issue) #:prefix "XA")
+ (for-each (cut index-text! term-generator <> #:prefix "XI")
+ (issue-assigned issue))
+ term-generator))
+
(define-method (print (issue <issue>) mset port)
"Print ISSUE, an <issue> object, in search results."
(let ((number-of-posts (length (file-document-commits issue))))
diff --git a/tissue/search.scm b/tissue/search.scm
index 8dac645..b9feafc 100644
--- a/tissue/search.scm
+++ b/tissue/search.scm
@@ -49,13 +49,13 @@ mapping field names to prefixes."
query-parser))
(define %prefixes
- '(("title" . "S")))
+ '(("title" . "S")
+ ("creator" . "A")
+ ("lastupdater" . "XA")
+ ("assigned" . "XI")))
(define %boolean-prefixes
'(("type" . "XT")
- ("creator" . "A")
- ("lastupdater" . "XA")
- ("assigned" . "XI")
("keyword" . "K")
("tag" . "K")
("is" . "XS")))