We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c407be commit 0f22449Copy full SHA for 0f22449
elasticsearch-model/examples/activerecord_associations.rb
@@ -98,6 +98,22 @@ module Searchable
98
99
module Indexing
100
101
+ #Index only the specified fields
102
+ settings do
103
+ mappings dynamic: false do
104
+ indexes :categories, type: :object do
105
+ indexes :title
106
+ end
107
+ indexes :authors, type: :object do
108
+ indexes :full_name
109
+ indexes :department
110
111
+ indexes :comments, type: :object do
112
+ indexes :text
113
114
115
116
+
117
# Customize the JSON serialization for Elasticsearch
118
def as_indexed_json(options={})
119
self.as_json(
0 commit comments