def proximity_array_for_content(doc, &block)
      return [] if needs_rebuild?

      content_node = node_for_content(doc, &block)
      result =
        @items.keys.collect do |item|
          val = if $GSL
                  content_node.search_vector * @items[item].transposed_search_vector
                else
                  (Matrix[content_node.search_vector] * @items[item].search_vector)[0]
                end
          [item, val]
        end
      result.sort_by { |x| x[1] }.reverse
    end
def proximity_array_for_content(doc, &block)
      return [] if needs_rebuild?

      content_node = node_for_content(doc, &block)
      result =
        @items.keys.collect do |item|
          val = if $GSL
                  content_node.search_vector * @items[item].transposed_search_vector
                else
                  (Matrix[content_node.search_vector] * @items[item].search_vector)[0]
                end
          [item, val]
        end
      result.sort_by { |x| x[1] }.reverse
    end
This function is the primitive that find_related and classify
 build upon. It returns an array of 2-element arrays. The first element
 of this array is a document, and the second is its "score", defining
 how "close" it is to other indexed items.

 These values are somewhat arbitrary, having to do with the vector space
 created by your content, so the magnitude is interpretable but not always
 meaningful between indexes.

 The parameter doc is the content to compare. If that content is not
 indexed, you can pass an optional block to define how to create the
 text data. See add_item for examples of how this works.