anchor.diff:                         (when (> (length people) 5)
                            (htm
                              (:div :class "more-results" (:a :href (s+ "/search?scope=people&q=" (url-encode q)) (fmt "see ~d more people" (- (length people) 5))))))))
  +                   (when groups
  +                     (htm
  +                       (:h2 (:a :href (s+ "/search?scope=groups&q=" (url-encode q)) "Groups"))
  +                       (str (groups-results-html (sublist groups 0 5)))
  +                       (when (> (length groups) 5)
  +                         (htm
  +                           (:div :class "more-results" (:a :href (s+ "/search?scope=groups&q=" (url-encode q)) (fmt "see ~d more groups" (- (length groups) 5))))))))
                      (when requests
                        (htm
                          (:h2 (:a :href (s+ "/requests?q=" (url-encode q)) "Requests")
  
positive.code: ;    (+ mutuals ) ) )
  
  (defun search-people (query &key (userid *userid*))
    (let* ((aliases (metaphone-index-query query))
           (user (db userid))
           (lat (getf user :lat))
           (long (getf user :long))
  
negative.code:               (sort aliases; (remove userid people :key #'result-id)
                      #'> :key #'person-rank)))))
  
  (defun search-groups (query &key (userid *userid*))
    (let* ((aliases (remove-if-not #'alias-group-p (metaphone-index-query query)))
           (user (db userid)) 
           (lat (getf user :lat))
           (long (getf user :long)))
      (flet ((group-rank (alias)
               (let* ((result (alias-result alias))
                      (member-count (length (db (result-id result) :members)))
                      (distance (air-distance lat long (result-latitude result) (result-longitude result))))
                 (+ (* 9 member-count)
                    (/ 50 (log (+ 4 distance) 10)))))
             (group-id (alias)
               (result-id (alias-result alias))))
  
        (mapcar #'group-id
              (sort aliases
                    #'> :key #'group-rank)))))
  
  (defun request-results-html (request-list)
    (html
      (dolist (item request-list)
  