summaryrefslogtreecommitdiff
path: root/tissue/commit.scm
diff options
context:
space:
mode:
authorArun Isaac2022-07-13 17:43:03 +0530
committerArun Isaac2022-07-19 17:37:06 +0530
commitd4cd8ad34b39cea2566e421d9b84ae6d73553db9 (patch)
treee94dc9fa7377cd33cfef81706d6d8858540ac86f /tissue/commit.scm
parente2fe50c591706a7902048aaef911ce433522a322 (diff)
downloadtissue-d4cd8ad34b39cea2566e421d9b84ae6d73553db9.tar.gz
tissue-d4cd8ad34b39cea2566e421d9b84ae6d73553db9.tar.lz
tissue-d4cd8ad34b39cea2566e421d9b84ae6d73553db9.zip
document: Index boolean terms.
Metadata that will be used in boolean filtering should be indexed as boolean terms, not as free text. This also results in the happy coincidence that we no longer need a specialized document-term-generator generic method for <issue> and <commit>. * tissue/document.scm (document-boolean-terms): New public generic function. (document-term-generator): Use document-boolean-terms. * tissue/issue.scm (document-boolean-terms): New generic method. (document-term-generator): Delete generic method. * tissue/commit.scm (document-boolean-terms): New generic method. (document-term-generator): Delete generic method.
Diffstat (limited to 'tissue/commit.scm')
-rw-r--r--tissue/commit.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/tissue/commit.scm b/tissue/commit.scm
index 30d07b7..10dc436 100644
--- a/tissue/commit.scm
+++ b/tissue/commit.scm
@@ -42,16 +42,15 @@
"Return the ID term for DOCUMENT."
(string-append "Qcommit." (commit-hash commit)))
+(define-method (document-boolean-terms (commit <commit>))
+ "Return the boolean terms in COMMIT."
+ (list (string-append "Qcommit." (commit-hash commit))
+ (string-append "A" (doc:commit-author commit))))
+
(define-method (document-recency-date (commit <commit>))
"Return a date representing the recency of DOCUMENT"
(doc:commit-author-date commit))
-(define-method (document-term-generator (commit <commit>))
- "Return a term generator indexing COMMIT."
- (let ((term-generator (next-method)))
- (index-person! term-generator (doc:commit-author commit) "A")
- term-generator))
-
(define-method (document-snippet-source-text (commit <commit>))
"Return the source text for COMMIT from which to extract a search
result snippet."