@@ -412,27 +412,27 @@ Connection and index names in query overrides connection and index names in conf
412
412
413
413
##### Getting document by id
414
414
``` php
415
- $documents = ES::type("my_type")->id(3)->get ();
415
+ ES::type("my_type")->id(3)->first ();
416
416
417
417
# or
418
418
419
- $documents = ES::type("my_type")->_id(3)->get ();
419
+ ES::type("my_type")->_id(3)->first ();
420
420
```
421
421
##### Sorting
422
422
``` php
423
- $documents = ES::type("my_type")->orderBy("created_at", "desc")->get();
423
+ ES::type("my_type")->orderBy("created_at", "desc")->get();
424
424
425
425
# Sorting with text search score
426
426
427
- $documents = ES::type("my_type")->orderBy("_score")->get();
427
+ ES::type("my_type")->orderBy("_score")->get();
428
428
```
429
429
##### Limit and offset
430
430
``` php
431
- $documents = ES::type("my_type")->take(10)->skip(5)->get();
431
+ ES::type("my_type")->take(10)->skip(5)->get();
432
432
```
433
433
##### Select only specific fields
434
434
``` php
435
- $documents = ES::type("my_type")->select("title", "content")->take(10)->skip(5)->get();
435
+ ES::type("my_type")->select("title", "content")->take(10)->skip(5)->get();
436
436
```
437
437
##### Where clause
438
438
``` php
@@ -603,28 +603,55 @@ ES::type("my_type")->scrollID("DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAFMFlJQOEtTdnJIUklhc
603
603
``` php
604
604
$documents = ES::type("my_type")->search("bar")->paginate(5);
605
605
606
- # getting pagination links
606
+ # Getting pagination links
607
607
608
608
$documents->links();
609
609
610
+ # Bootstrap 4 pagination
611
+
612
+ $documents->links("bootstrap-4");
613
+
614
+ # Simple bootstrap 4 pagination
615
+
616
+ $documents->links("simple-bootstrap-4");
617
+
618
+ # Simple pagination
619
+
620
+ $documents->links("simple-default");
621
+ ```
622
+
623
+ These are all pagination methods you may use:
624
+
625
+ ``` php
626
+ $documents->count()
627
+ $documents->currentPage()
628
+ $documents->firstItem()
629
+ $documents->hasMorePages()
630
+ $documents->lastItem()
631
+ $documents->lastPage()
632
+ $documents->nextPageUrl()
633
+ $documents->perPage()
634
+ $documents->previousPageUrl()
635
+ $documents->total()
636
+ $documents->url($page)
610
637
```
611
638
612
639
##### Getting the query array without execution
613
640
614
641
``` php
615
- $query = ES::type("my_type")->search("foo")->where("views", ">", 150)->query();
642
+ ES::type("my_type")->search("foo")->where("views", ">", 150)->query();
616
643
```
617
644
618
645
##### Getting the original elasticsearch response
619
646
620
647
``` php
621
- $query = ES::type("my_type")->search("foo")->where("views", ">", 150)->response();
648
+ ES::type("my_type")->search("foo")->where("views", ">", 150)->response();
622
649
```
623
650
624
651
##### Ignoring bad HTTP response
625
652
626
653
``` php
627
- $documents = ES::type("my_type")->ignore(404, 500)->id(5)->first();
654
+ ES::type("my_type")->ignore(404, 500)->id(5)->first();
628
655
```
629
656
630
657
##### Query Caching (Laravel & Lumen)
0 commit comments