@@ -87,7 +87,9 @@ If you don't want to enable working with Lumen facades you can access the query
87
87
88
88
``` php
89
89
app("es")->index("my_index")->type("my_type")->get();
90
+
90
91
# is similar to
92
+
91
93
ES::index("my_index")->type("my_type")->get();
92
94
```
93
95
@@ -298,11 +300,11 @@ $ php artisan es:indices:reindex my_index my_new_index --bulk-size=2000 --scroll
298
300
299
301
# Skip reindexing errors such as mapper parsing exceptions.
300
302
301
- $ php artisan es:indices:reindex my_index my_new_index --bulk-size=2000 --skip-errors
303
+ $ php artisan es:indices:reindex my_index my_new_index --bulk-size=2000 --skip-errors
302
304
303
305
# Hide all reindexing errors and show the progres bar only.
304
306
305
- $ php artisan es:indices:reindex my_index my_new_index --bulk-size=2000 --hide-errors
307
+ $ php artisan es:indices:reindex my_index my_new_index --bulk-size=2000 --skip-errors -- hide-errors
306
308
```
307
309
308
310
5 ) Remove ` my_index_alias ` alias from ` my_index ` and add it to ` my_new_index ` in configuration file and update with command:
@@ -567,38 +569,36 @@ ES::type("my_type")->search("bar")->count();
567
569
568
570
##### Scan-and-Scroll queries
569
571
570
- These queries are suitable for large amount of data.
571
- A scrolled search allows you to do an initial search and to keep pulling batches of results
572
- from Elasticsearch until there are no more results left. It’s a bit like a cursor in a traditional database
573
572
574
- ``` php
573
+
574
+ ``` php
575
+ # These queries are suitable for large amount of data.
576
+ # A scrolled search allows you to do an initial search and to keep pulling batches of results
577
+ # from Elasticsearch until there are no more results left.
578
+ # It’s a bit like a cursor in a traditional database
579
+
575
580
$documents = ES::type("my_type")->search("foo")
576
581
->scroll("2m")
577
582
->take(1000)
578
583
->get();
579
- ```
580
- Response will contain a hashed code ` scroll_id ` will be used to get the next result by running
581
584
582
- ``` php
585
+ # Response will contain a hashed code `scroll_id` will be used to get the next result by running
586
+
583
587
$documents = ES::type("my_type")->search("foo")
584
588
->scroll("2m")
585
589
->scrollID("DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAFMFlJQOEtTdnJIUklhcU1FX2VqS0EwZncAAAAAAAABSxZSUDhLU3ZySFJJYXFNRV9laktBMGZ3AAAAAAAAAU4WUlA4S1N2ckhSSWFxTUVfZWpLQTBmdwAAAAAAAAFPFlJQOEtTdnJIUklhcU1FX2VqS0EwZncAAAAAAAABTRZSUDhLU3ZySFJJYXFNRV9laktBMGZ3")
586
590
->get();
587
- ```
588
-
589
- And so on ...
590
-
591
- Note that you don't need to write the query parameters in every scroll.
592
- All you need the ` scroll_id ` and query scroll time.
593
-
594
- To clear ` scroll_id `
591
+
592
+ # And so on ...
593
+ # Note that you don't need to write the query parameters in every scroll. All you need the `scroll_id` and query scroll time.
595
594
596
- ``` php
595
+ # To clear `scroll_id`
596
+
597
597
ES::type("my_type")->scrollID("DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAFMFlJQOEtTdnJIUklhcU1FX2VqS0EwZncAAAAAAAABSxZSUDhLU3ZySFJJYXFNRV9laktBMGZ3AAAAAAAAAU4WUlA4S1N2ckhSSWFxTUVfZWpLQTBmdwAAAAAAAAFPFlJQOEtTdnJIUklhcU1FX2VqS0EwZncAAAAAAAABTRZSUDhLU3ZySFJJYXFNRV9laktBMGZ3")
598
598
->clear();
599
599
```
600
600
601
- ##### Paginate results with per_page = 5
601
+ ##### Paginate results with 5 records per page
602
602
603
603
``` php
604
604
$documents = ES::type("my_type")->search("bar")->paginate(5);
0 commit comments