Class: Droonga::Searcher::ComplexAttributesFormatter
- Inherits:
-
Object
- Object
- Droonga::Searcher::ComplexAttributesFormatter
- Includes:
- AttributeFormattable
- Defined in:
- lib/droonga/searcher.rb
Instance Method Summary collapse
- #format_attribute_column(label, column) ⇒ Object
- #format_attribute_expression(label, expression) ⇒ Object
- #format_attribute_subrecs(label, sub_attributes) ⇒ Object
- #format_attributes(attributes, table) ⇒ Object
Methods included from AttributeFormattable
Instance Method Details
#format_attribute_column(label, column) ⇒ Object
420 421 422 423 |
# File 'lib/droonga/searcher.rb', line 420 def format_attribute_column(label, column) vector = column.respond_to?(:vector?) ? column.vector? : false {"type" => column.range.name, "vector" => vector} end |
#format_attribute_expression(label, expression) ⇒ Object
425 426 427 |
# File 'lib/droonga/searcher.rb', line 425 def format_attribute_expression(label, expression) {} # TODO include detailed information of expression end |
#format_attribute_subrecs(label, sub_attributes) ⇒ Object
414 415 416 417 418 |
# File 'lib/droonga/searcher.rb', line 414 def format_attribute_subrecs(label, sub_attributes) { "attributes" => sub_attributes } end |
#format_attributes(attributes, table) ⇒ Object
429 430 431 432 433 434 435 436 437 |
# File 'lib/droonga/searcher.rb', line 429 def format_attributes(attributes, table) formatted_attributes = {} attributes.each do |attribute| formatted_attribute = format_attribute(attribute, table) attribute_name = attribute[:label] formatted_attributes[attribute_name] = formatted_attribute end formatted_attributes end |