Skip to content
Browse files

Fixed backtrace when searching with no input, prioritized todo list

  • Loading branch information...
1 parent d8d53dd commit 34d27677c8150df363988437033491a0b75dd733 @vsedach committed
Showing with 11 additions and 11 deletions.
  1. +4 −4 TODO
  2. +7 −7 src/search.lisp
View
8 TODO
@@ -1,8 +1,8 @@
-* fix BS with clhs-lookup pathnames and Symbol-Table.text
* article deletion (404 on subsequent access but still have history)
-* table colors and formatting
* create article button
-* make paginated lists longer than 19 pages long pretty (all-articles page)
+* fix BS with clhs-lookup pathnames and Symbol-Table.text
* make sure ASDF-Install still works
* robots.txt for site/ crawling
-* expires headers for images
+* expires headers for images
+* table colors and formatting
+* make paginated lists longer than 19 pages long pretty (all-articles page)
View
14 src/search.lisp
@@ -36,19 +36,19 @@
(add-to-entry entry article))))
(defun search-articles (phrase)
- (let ((words (words phrase)))
+ (awhen (words phrase)
(sort (copy-list
(reduce #'intersection
(mapcar (lambda (word)
(awhen (find-concordance-entry word)
(articles it)))
- words)))
+ it)))
#'< :key (lambda (article)
- (loop for word in words
- for weight from 0 by 100
- thereis (awhen (search word (canonical-title article))
- (+ weight it))
- finally (return most-positive-fixnum))))))
+ (loop for word in it
+ for weight from 0 by 100
+ thereis (awhen (search word (canonical-title article))
+ (+ weight it))
+ finally (return most-positive-fixnum))))))
(defun paginate-article-summaries (start articles &optional (next-page-uri "?"))
(let ((page-size 10)

0 comments on commit 34d2767

Please sign in to comment.
Something went wrong with that request. Please try again.