Class: Fluent::Plugin::GroongaOutput::TableDefinition::IndexDefinition
- Inherits:
-
Object
- Object
- Fluent::Plugin::GroongaOutput::TableDefinition::IndexDefinition
- Includes:
- DefinitionParseMethods
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #flags ⇒ Object
-
#initialize(table, raw) ⇒ IndexDefinition
constructor
A new instance of IndexDefinition.
- #name ⇒ Object
- #source_columns ⇒ Object
- #source_table ⇒ Object
- #to_create_arguments ⇒ Object
Constructor Details
#initialize(table, raw) ⇒ IndexDefinition
Returns a new instance of IndexDefinition.
228 229 230 231 |
# File 'lib/fluent/plugin/out_groonga.rb', line 228 def initialize(table, raw) @table = table @raw = raw end |
Instance Method Details
#flags ⇒ Object
245 246 247 248 249 250 |
# File 'lib/fluent/plugin/out_groonga.rb', line 245 def flags _flags = ["COLUMN_INDEX"] _flags << "WITH_POSITION" if @table.default_tokenizer _flags << "WITH_SECTION" if source_columns.size >= 2 _flags end |
#name ⇒ Object
233 234 235 |
# File 'lib/fluent/plugin/out_groonga.rb', line 233 def name @raw[:name] end |
#source_columns ⇒ Object
241 242 243 |
# File 'lib/fluent/plugin/out_groonga.rb', line 241 def source_columns parse_items(@raw[:source_columns]) end |
#source_table ⇒ Object
237 238 239 |
# File 'lib/fluent/plugin/out_groonga.rb', line 237 def source_table @raw[:source_table] end |
#to_create_arguments ⇒ Object
252 253 254 255 256 257 258 259 260 |
# File 'lib/fluent/plugin/out_groonga.rb', line 252 def to_create_arguments { "table" => @table.name, "name" => name, "flags" => flags.join("|"), "type" => source_table, "source" => source_columns.join(","), } end |