File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,23 @@ class PostController extends Controller
185185}
186186```
187187
188+ ## Adding via Query
189+ The ` searchable() ` method will chunk the results of the query and add the records to your search index.
190+
191+ $post = Post::find(1);
192+
193+ // You may also add record via collection...
194+ $post->searchable();
195+
196+ // OR
197+
198+ $posts = Post::where('year', '>', '2018')->get();
199+
200+ // You may also add records via collections...
201+ $posts->searchable();
202+
203+ When using constraints apply it after the constraints are added to the query, as seen in the above example.
204+
188205## OrderBy
189206An ` orderBy() ` statement can now be applied to the search query similar to the ` where() ` statement.
190207
You can’t perform that action at this time.
0 commit comments