def add_index(column, type, keep = false)
      type =  case type.to_s
              when "lexical", "string"  then lib::INDEXES[:TDBITLEXICAL]
              when "decimal", "numeric" then lib::INDEXES[:TDBITDECIMAL]
              when "token"              then lib::INDEXES[:TDBITTOKEN]
              when "qgram"              then lib::INDEXES[:TDBITQGRAM]
              else
                fail Error::IndexError, "unknown index type"
              end
      type |= lib::INDEXES[:TDBITKEEP] if keep
      try( :setindex,
           cast_to_bytes_and_length(column_name(column)).first,
           type,
           :no_error => {21 => false} )
    end
def add_index(column, type, keep = false)
      type =  case type.to_s
              when "lexical", "string"  then lib::INDEXES[:TDBITLEXICAL]
              when "decimal", "numeric" then lib::INDEXES[:TDBITDECIMAL]
              when "token"              then lib::INDEXES[:TDBITTOKEN]
              when "qgram"              then lib::INDEXES[:TDBITQGRAM]
              else
                fail Error::IndexError, "unknown index type"
              end
      type |= lib::INDEXES[:TDBITKEEP] if keep
      try( :setindex,
           cast_to_bytes_and_length(column_name(column)).first,
           type,
           :no_error => {21 => false} )
    end
Indexes