Commit 4bfb101ac4cce9dc35a241949407abfc55721251
1 parent
a85c6e2f
Exists in
master
and in
21 other branches
Added mapping code for conversions
Showing
1 changed file
with
11 additions
and
0 deletions
Show diff stats
README.md
@@ -57,6 +57,17 @@ Add the conversions to the index. | @@ -57,6 +57,17 @@ Add the conversions to the index. | ||
57 | class Book < ActiveRecord::Base | 57 | class Book < ActiveRecord::Base |
58 | has_many :searches | 58 | has_many :searches |
59 | 59 | ||
60 | + tire do | ||
61 | + settings Searchkick.settings | ||
62 | + mapping do | ||
63 | + indexes :title, analyzer: "searchkick" | ||
64 | + indexes :conversions, type: "nested" do | ||
65 | + indexes :query, analyzer: "searchkick_keyword" | ||
66 | + indexes :count, type: "integer" | ||
67 | + end | ||
68 | + end | ||
69 | + end | ||
70 | + | ||
60 | def to_indexed_json | 71 | def to_indexed_json |
61 | { | 72 | { |
62 | title: title, | 73 | title: title, |