Brak opisu

EsModel.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace App\Support;
  3. use App\Components\EsNative;
  4. /**
  5. * Class EsModel
  6. * @package App\Models\Es
  7. */
  8. class EsModel {
  9. public static function createIdx($index) {
  10. /** @var EsNative $es */
  11. $es = app('es');
  12. return $es->createIdx($index);
  13. }
  14. public static function deleteIdx($index) {
  15. /** @var EsNative $es */
  16. $es = app('es');
  17. return $es->deleteIdx($index);
  18. }
  19. public static function existsIdx($index) {
  20. /** @var EsNative $es */
  21. $es = app('es');
  22. return $es->existsIdx($index);
  23. }
  24. public static function addDoc($params) {
  25. /** @var EsNative $es */
  26. $es = app('es');
  27. return $es->addDoc($params);
  28. }
  29. public static function deleteDoc($params) {
  30. /** @var EsNative $es */
  31. $es = app('es');
  32. return $es->deleteDoc($params);
  33. }
  34. public static function updateDoc($params) {
  35. /** @var EsNative $es */
  36. $es = app('es');
  37. return $es->updateDoc($params);
  38. }
  39. public static function searchDoc($params) {
  40. /** @var EsNative $es */
  41. $es = app('es');
  42. return $es->searchDoc($params);
  43. }
  44. public static function bulkDoc($data) {
  45. /** @var EsNative $es */
  46. $es = app('es');
  47. return $es->bulkDoc($data);
  48. }
  49. public static function countDoc($data) {
  50. /** @var EsNative $es */
  51. $es = app('es');
  52. return $es->countDoc($data);
  53. }
  54. public static function addAlias($params) {
  55. /** @var EsNative $es */
  56. $es = app('es');
  57. return $es->addAlias($params);
  58. }
  59. }