lookup (FastRI::FullTextIndex)

    # File lib/fastri/full_text_index.rb, line 63
      def lookup(term)
        get_fulltext_IO do |fulltextIO|
          get_sarray_IO do |sarrayIO|
            case sarrayIO
            when StringIO
              num_suffixes = sarrayIO.string.size / 4 - 1
            else
              num_suffixes = sarrayIO.stat.size / 4 - 1
            end

            index, offset = binary_search(sarrayIO, fulltextIO, term, 0, num_suffixes)
            if offset
              fulltextIO.pos = offset
              path, metadata = find_metadata(fulltextIO)
              return Result.new(self, term, index, path, metadata) if path
            else
              nil
            end
          end
        end
      end