class ROM::Elasticsearch::Attribute
ES-specific attribute types for schemas
@api public
Constants
- DEFAULT_SORT_DIRECTION
- INTERNAL_META_KEYS
Public Instance Methods
asc()
click to toggle source
Return attribute with direction set to ascending
@return [Attribute]
@api public
# File lib/rom/elasticsearch/attribute.rb, line 37 def asc meta(direction: "asc") end
desc()
click to toggle source
Return attribute with direction set to descending
@return [Attribute]
@api public
# File lib/rom/elasticsearch/attribute.rb, line 46 def desc meta(direction: "desc") end
direction()
click to toggle source
# File lib/rom/elasticsearch/attribute.rb, line 56 def direction meta[:direction] || DEFAULT_SORT_DIRECTION end
properties()
click to toggle source
# File lib/rom/elasticsearch/attribute.rb, line 19 def properties type.meta.reject { |k, _| INTERNAL_META_KEYS.include?(k) } end
properties?()
click to toggle source
Return if an attribute has any ES mappings
@return [Bool]
@api public
# File lib/rom/elasticsearch/attribute.rb, line 28 def properties? properties.size.positive? end
to_sort_expr()
click to toggle source
# File lib/rom/elasticsearch/attribute.rb, line 51 def to_sort_expr "#{name}:#{direction}" end