anchor.diff:  (defun add-to-index (thing type &optional
                        package (index *cl-doc-index*)
                        &aux (doc-fn (doc-fn type))
  -                     (document (funcall doc-fn thing type package)))
  +                     (new-doc (funcall doc-fn thing type package))
  +                     )
     "add documentation for a specific thing of type from a package "
  -  (when document
  -    (montezuma:add-document-to-index index document)))
  +  (when new-doc
  +    (montezuma:delete-document index (cl-doc-key-term package thing type))
  +    (montezuma:add-document-to-index index new-doc)
  +    (montezuma:flush index)))
   
   (defun index-package (package-name)
     "Add package documentation and docs for all public symbols to the index"
  
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
  