def set_index (column_name, *types)

      column_name = column_name == :pk ? '' : column_name.to_s

      ii = types.inject(0) { |i, t| i = i | INDEX_TYPES[t]; i }

      lib.tab_setindex(@db, column_name, ii)
    end
def set_index (column_name, *types)

      column_name = column_name == :pk ? '' : column_name.to_s

      ii = types.inject(0) { |i, t| i = i | INDEX_TYPES[t]; i }

      lib.tab_setindex(@db, column_name, ii)
    end
Sets an index on a column of the table.

 Types maybe be :lexical or :decimal.

 Recently (TC 1.4.26 and 1.4.27) inverted indexes have been added,
 they are :token and :qgram. There is an :opt index as well.

 Sorry couldn't find any good doc about those inverted indexes apart from :

   http://alpha.mixi.co.jp/blog/?p=1147
   http://www.excite-webtl.jp/world/english/web/?wb_url=http%3A%2F%2Falpha.mixi.co.jp%2Fblog%2F%3Fp%3D1147&wb_lp=JAEN&wb_dis=2&wb_submit=+%96%7C+%96%F3+

 Use :keep to "add" and
 :remove (or :void) to "remove" an index.

 If column_name is :pk or "", the index will be set on the primary key.

 Returns true in case of success.