Commit 69b4aba7b267cb57ffe9355b9be6723660043145
1 parent
ebd9bdfa
Exists in
master
and in
21 other branches
Updated readme
Showing
1 changed file
with
12 additions
and
6 deletions
Show diff stats
README.md
... | ... | @@ -116,6 +116,12 @@ Limit / offset |
116 | 116 | limit: 20, offset: 40 |
117 | 117 | ``` |
118 | 118 | |
119 | +Select | |
120 | + | |
121 | +```ruby | |
122 | +select_v2: ["name"] | |
123 | +``` | |
124 | + | |
119 | 125 | ### Results |
120 | 126 | |
121 | 127 | Searches return a `Searchkick::Results` object. This responds like an array to most methods. |
... | ... | @@ -127,6 +133,12 @@ results.any? |
127 | 133 | results.each { |result| ... } |
128 | 134 | ``` |
129 | 135 | |
136 | +By default, ids are fetched from Elasticsearch and records are fetched from your database. To fetch everything from Elasticsearch, use: | |
137 | + | |
138 | +```ruby | |
139 | +Product.search("apples", load: false) | |
140 | +``` | |
141 | + | |
130 | 142 | Get total results |
131 | 143 | |
132 | 144 | ```ruby |
... | ... | @@ -1270,12 +1282,6 @@ Eager load associations |
1270 | 1282 | Product.search "milk", include: [:brand, :stores] |
1271 | 1283 | ``` |
1272 | 1284 | |
1273 | -Do not load models | |
1274 | - | |
1275 | -```ruby | |
1276 | -Product.search "milk", load: false | |
1277 | -``` | |
1278 | - | |
1279 | 1285 | Turn off special characters |
1280 | 1286 | |
1281 | 1287 | ```ruby | ... | ... |