Class: Fluent::GroongaOutput::TableDefinition::IndexDefinition
- Inherits:
-
Object
- Object
- Fluent::GroongaOutput::TableDefinition::IndexDefinition
- 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.
217 218 219 220 |
# File 'lib/fluent/plugin/out_groonga.rb', line 217 def initialize(table, raw) @table = table @raw = raw end |
Instance Method Details
#flags ⇒ Object
234 235 236 237 238 239 |
# File 'lib/fluent/plugin/out_groonga.rb', line 234 def flags _flags = ["COLUMN_INDEX"] _flags << "WITH_POSITION" if @table.use_n_gram_tokenizer? _flags << "WITH_SECTION" if source_columns.size >= 2 _flags end |
#name ⇒ Object
222 223 224 |
# File 'lib/fluent/plugin/out_groonga.rb', line 222 def name @raw[:name] end |
#source_columns ⇒ Object
230 231 232 |
# File 'lib/fluent/plugin/out_groonga.rb', line 230 def source_columns @raw[:source_columns] end |
#source_table ⇒ Object
226 227 228 |
# File 'lib/fluent/plugin/out_groonga.rb', line 226 def source_table @raw[:source_table] end |
#to_create_arguments ⇒ Object
241 242 243 244 245 246 247 248 249 |
# File 'lib/fluent/plugin/out_groonga.rb', line 241 def to_create_arguments { "table" => @table.name, "name" => name, "flags" => flags.join, "type" => source_table, "source" => source_columns, } end |