Class: Solr::Query::Request::Sorting::Field
- Inherits:
-
Object
- Object
- Solr::Query::Request::Sorting::Field
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/sorting/field.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, direction:) ⇒ Field
constructor
A new instance of Field.
- #solr_field ⇒ Object
-
#to_solr_s ⇒ Object
sorting nulls last, not-nulls first.
Methods included from Support::SchemaHelper
Constructor Details
#initialize(name:, direction:) ⇒ Field
Returns a new instance of Field.
10 11 12 13 14 |
# File 'lib/solr/query/request/sorting/field.rb', line 10 def initialize(name:, direction:) @name = name @direction = direction freeze end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
8 9 10 |
# File 'lib/solr/query/request/sorting/field.rb', line 8 def direction @direction end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/solr/query/request/sorting/field.rb', line 8 def name @name end |
Instance Method Details
#solr_field ⇒ Object
21 22 23 |
# File 'lib/solr/query/request/sorting/field.rb', line 21 def solr_field solarize_field(name) end |
#to_solr_s ⇒ Object
sorting nulls last, not-nulls first
17 18 19 |
# File 'lib/solr/query/request/sorting/field.rb', line 17 def to_solr_s "exists(#{solr_field}) desc, #{solr_field} #{direction}" end |