[Groonga-commit] droonga/fluent-plugin-droonga at 9e02a3a [master] Support multi column index

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Feb 6 15:41:58 JST 2014


Kouhei Sutou	2014-02-06 15:41:58 +0900 (Thu, 06 Feb 2014)

  New Revision: 9e02a3a73e18796bd115fad999cdc8540f75cff3
  https://github.com/droonga/fluent-plugin-droonga/commit/9e02a3a73e18796bd115fad999cdc8540f75cff3

  Message:
    Support multi column index
    
    TODO: Write tests about the case

  Modified files:
    lib/droonga/plugin/handler/groonga/column_create.rb

  Modified: lib/droonga/plugin/handler/groonga/column_create.rb (+4 -2)
===================================================================
--- lib/droonga/plugin/handler/groonga/column_create.rb    2014-02-06 15:37:32 +0900 (d2417a2)
+++ lib/droonga/plugin/handler/groonga/column_create.rb    2014-02-06 15:41:58 +0900 (16c25ce)
@@ -73,12 +73,14 @@ module Droonga
       def define_index
         table_name = @command["table"]
         target_table = @command["type"]
-        target_column = @command["source"]
+        target_columns = (@command["source"] || "").split(/\s*,\s*/)
 
         options = create_index_options
         Groonga::Schema.define(:context => @context) do |schema|
           schema.change_table(table_name) do |table|
-            table.index("#{target_table}.#{target_column}", options)
+            arguments = [target_table, *target_columns]
+            arguments << options
+            table.index(*arguments)
           end
         end
         true
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index