lib/active_groonga/schema.rb in activegroonga-0.0.1 vs lib/active_groonga/schema.rb in activegroonga-0.0.2
- old
+ new
@@ -104,17 +104,16 @@
table_name)
FileUtils.mkdir_p(base_dir)
name = "#{table_name}/#{column_name}"
path = File.join(base_dir, "#{column_name}.groonga")
- index_column = index_table.define_column(name, table,
- :path => path,
- :type => "index",
- :compress => "zlib",
- # :with_section => true,
- # :with_weight => true,
- :with_position => true)
+ index_column = index_table.define_index_column(name, table,
+ :path => path,
+ :compress => "zlib",
+ # :with_section => true,
+ # :with_weight => true,
+ :with_position => true)
index_column.source = column
record = index_management_table.add
record["table"] = groonga_table_name
record["column"] = column_name
@@ -195,9 +194,10 @@
table = Groonga::PatriciaTrie.create(:name => groonga_table_name,
:key_type => "<shorttext>",
# :key_with_sis => true,
# :key_normalize => true,
:path => table_file)
+ table.default_tokenizer = "<token:bigram>"
base_dir = File.join(Base.metadata_directory, table_name)
FileUtils.mkdir_p(base_dir)
end
end