Class: Fluent::GroongaOutput::TableDefinition::IndexDefinition

Inherits:
Object
  • Object
show all
Includes:
DefinitionParseMethods
Defined in:
lib/fluent/plugin/out_groonga.rb

Instance Method Summary (collapse)

Constructor Details

- (IndexDefinition) initialize(table, raw)

Returns a new instance of IndexDefinition



219
220
221
222
# File 'lib/fluent/plugin/out_groonga.rb', line 219

def initialize(table, raw)
  @table = table
  @raw = raw
end

Instance Method Details

- (Object) flags



236
237
238
239
240
241
# File 'lib/fluent/plugin/out_groonga.rb', line 236

def flags
  _flags = ["COLUMN_INDEX"]
  _flags << "WITH_POSITION" if @table.default_tokenizer
  _flags << "WITH_SECTION" if source_columns.size >= 2
  _flags
end

- (Object) name



224
225
226
# File 'lib/fluent/plugin/out_groonga.rb', line 224

def name
  @raw[:name]
end

- (Object) source_columns



232
233
234
# File 'lib/fluent/plugin/out_groonga.rb', line 232

def source_columns
  parse_items(@raw[:source_columns])
end

- (Object) source_table



228
229
230
# File 'lib/fluent/plugin/out_groonga.rb', line 228

def source_table
  @raw[:source_table]
end

- (Object) to_create_arguments



243
244
245
246
247
248
249
250
251
# File 'lib/fluent/plugin/out_groonga.rb', line 243

def to_create_arguments
  {
    "table"  => @table.name,
    "name"   => name,
    "flags"  => flags.join("|"),
    "type"   => source_table,
    "source" => source_columns.join(","),
  }
end