elasticsearch-model/test/integration/active_record_associations_test.rb
# Customize the JSON serialization for Elasticsearch
#
Customize the JSON serialization for Elasticsearch
Customize the JSON serialization for Elasticsearch
def as_indexed_json(options={})
                {
                  title: title,
                  text:  text,
                  categories: categories.map(&:title),
                  authors:    authors.as_json(methods: [:full_name], only: [:full_name, :first_name, :last_name]),
                  comments:   comments.as_json(only: [:text, :author])
                }
              end
def as_indexed_json ( options = { } ) { title : title , text : text , categories : categories . map ( & :title ) , authors : authors . as_json ( methods : [ :full_name ] , only : [ :full_name , :first_name , :last_name ] ) , comments : comments . as_json ( only : [ :text , :author ] ) } end
Customize the JSON serialization for Elasticsearch
Customize the JSON serialization for Elasticsearch
options
<not_specific>