def document_number(key)
      docnum = ferret_index.doc_number(key)
      # hits = ferret_index.search query_for_record(key)
      # return hits.hits.first.doc if hits.total_hits == 1
      raise "cannot determine document number for record #{key}" if docnum.nil?
      docnum
    end
def document_number(key)
      docnum = ferret_index.doc_number(key)
      # hits = ferret_index.search query_for_record(key)
      # return hits.hits.first.doc if hits.total_hits == 1
      raise "cannot determine document number for record #{key}" if docnum.nil?
      docnum
    end
retrieves the ferret document number of the record with the given key.