Class: MmEsSearch::Api::Sort::RootSort
- Inherits:
-
Object
- Object
- MmEsSearch::Api::Sort::RootSort
- Includes:
- MongoMapper::EmbeddedDocument
- Defined in:
- lib/mm_es_search/api/sort/root_sort.rb
Instance Method Summary collapse
Instance Method Details
#to_es_query ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/mm_es_search/api/sort/root_sort.rb', line 23 def to_es_query case direction when "asc", "ascending", nil {field => {:order => :asc}} when "desc", "descending" {field => {:order => :desc}} end end |
#to_mongo_query ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/mm_es_search/api/sort/root_sort.rb', line 14 def to_mongo_query case direction when "asc", "ascending", nil {field => :asc} when "desc", "descending" {field => :desc} end end |