Method: ElasticRecord::Callbacks#as_search
- Defined in:
- lib/elastic_record/callbacks.rb
#as_search ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/elastic_record/callbacks.rb', line 22 def as_search json = {} elastic_index.mapping[:properties].each do |field, mapping| value = elastic_search_value field, mapping unless value.nil? json[field] = value end end amend_as_search(json) if respond_to?(:amend_as_search) json end |