anchor.diff:      ;; this breaks when the field doesnt exist
       (montezuma:document-value doc field)))
   
  -(defun print-index-contents ( &optional (limit 1000) )
  +(defun print-default-search ( &optional (limit 1000) )
     "Prints the package, name and type of every document in the index (up to limit)"
  -  (iter (for i upfrom 0)
  -    (when limit (while (< i limit)))
  -    (for d = (get-doc i))
  -    (while d)
  -    (format T "~A:~A <~A>~%"
  -            (doc-value d :package)
  -            (doc-value d :name)
  -            (doc-value d :type))))
  +  (search-manifest "*" :n limit :show-docs? nil))
  +
  +(defun print-index-contents ( )
  +  "Prints the package, name and type of every document in the index (up to limit)"
  +  (iter (for what in (list* :package manifest::*categories*))
  +    (format T "~%~A:~%-------------" what )
  +    (print-docs-for-term :type what)
  +    (format T "~%-------------~%")))
  +
  +(defun cl-doc-key (package name type)
  +  (format nil "~A:~A:~A"
  +          (typecase package
  +            (package (package-name package))
  +            (t package))
  +          name type))
  +
  +(defun cl-doc-key-term (package name type)
  +  (make-term :id (cl-doc-key package name type)))
  +
  +(defun make-term ( field value )
  +  (montezuma:make-term
  +   (%to-s field)
  +   (%to-s value)))
  +
  +(defun find-doc-by-key (package name type)
  +  (get-doc (cl-doc-key-term package name type)))
   
   (defun search-manifest (phrase
                           &key
  -                        (n 25)
  -                        (show-docs? t))
  +                          (stream T)
  +                          (n 25)
  +                          (show-docs? t))
     "Searches through all of the known common lisp (in-process)
      documentation for the query and displays the results
   
  
positive.code:     (unless (member packages exclude-packages :key #'find-package)
        (index-package p))))
  
  (defun get-doc (idx)
    "Get a document for the thing passed in"
    (etypecase idx
      (montezuma:document idx)
      (integer
       (ignore-errors
        (montezuma:get-document *cl-doc-index* idx)))))
  
  (defun doc-value (idx field
                    &aux
  
negative.code:     (list (join-strings thing))
      (t (princ-to-string thing))))
  
  (defparameter +index-path+ #P"~/lisp/doc-index")
  
  (defvar *cl-doc-index* )
  
  (defun load-index ()
    (unless *cl-doc-index*
      (setf *cl-doc-index*
            (make-instance
             'montezuma:index
             :path +index-path+
  
             ;; :create-p T
             :create-if-missing-p T
     
             :default-field "*"
             :fields (mapcar #'%to-s '(:name :nicknames :type :package :documentation :readme))
             ))))
  
  (load-index)
  
  (defun close-index ()
    (montezuma:flush *cl-doc-index*)
    (montezuma:close *cl-doc-index*)
    (setf *cl-doc-index* nil))
  
  
  (defun doc-fn (type)
    "Try to find a specific make-doc function, failing that return make-default-doc"
    (handler-case
        (fdefinition (intern (format nil "MAKE-~A-DOC" type) :manifest-search))
      (undefined-function ()
        #'make-default-doc)))
  
  (defun doc-with-fields (&rest fields)
    "A shortcut for making a new montezuma document with field data"
    (let ((doc (make-instance 'montezuma:document)))
      (iter (for f in fields)
        (when f (montezuma:add-field doc f)))
      doc))
  
  (defun make-field (name value &optional
                                (tokenize? t))
    (montezuma:make-field
     (%to-s name)
     (%to-s value)
     :index (if tokenize? :tokenized :untokenized)))
  
  (defun make-default-doc (thing
                           &optional type package
  