Module: SearchFlip::Sourceable
- Included in:
- Aggregation, Criteria
- Defined in:
- lib/search_flip/sourceable.rb
Overview
The SearchFlip::Sortable mixin provides the chainable #source method to use elasticsearch source filtering
Class Method Summary collapse
Instance Method Summary collapse
-
#source(value) ⇒ SearchFlip::Criteria
Use to specify which fields of the source document you want Elasticsearch to return for each matching result.
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 |
# File 'lib/search_flip/sourceable.rb', line 6 def self.included(base) base.class_eval do attr_accessor :source_value end end |
Instance Method Details
#source(value) ⇒ SearchFlip::Criteria
Use to specify which fields of the source document you want Elasticsearch to return for each matching result.
24 25 26 27 28 |
# File 'lib/search_flip/sourceable.rb', line 24 def source(value) fresh.tap do |criteria| criteria.source_value = value end end |