| 1 | <?php |
||
| 10 | class SearchParams { |
||
| 11 | |||
| 12 | /* extrapolating elastic max results, ignoring elastic default as 10 */ |
||
| 13 | const DEFAULT_LIMIT_RESULTS = 1000000000; |
||
| 14 | |||
| 15 | protected $index; |
||
| 16 | |||
| 17 | protected $type; |
||
| 18 | |||
| 19 | protected $parent; |
||
| 20 | |||
| 21 | protected $body = []; |
||
| 22 | |||
| 23 | protected $from = 0; |
||
| 24 | |||
| 25 | protected $size = self::DEFAULT_LIMIT_RESULTS; |
||
| 26 | |||
| 27 | protected $sort = []; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function getIndex() { |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $index |
||
| 38 | * @return SearchParams |
||
| 39 | */ |
||
| 40 | public function setIndex($index) { |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function getType() { |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $type |
||
| 54 | * @return SearchParams |
||
| 55 | */ |
||
| 56 | public function setType($type) { |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function getBody() { |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param array $body |
||
| 70 | * @return SearchParams |
||
| 71 | */ |
||
| 72 | public function setBody(array $body = []) { |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return int |
||
| 79 | */ |
||
| 80 | public function getSize() { |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @param int $size |
||
| 86 | * @return SearchParams |
||
| 87 | */ |
||
| 88 | public function setSize($size) { |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @return mixed |
||
| 95 | */ |
||
| 96 | public function getSort() { |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @param array $sort |
||
| 102 | * @return SearchParams |
||
| 103 | */ |
||
| 104 | public function setSort(array $sort = []) { |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @return int |
||
| 111 | */ |
||
| 112 | public function getFrom() { |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @param int $from |
||
| 118 | * @return SearchParams |
||
| 119 | */ |
||
| 120 | public function setFrom($from) { |
||
| 124 | |||
| 125 | /** |
||
| 126 | * @return mixed |
||
| 127 | */ |
||
| 128 | public function getParent() { |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @param mixed $parent |
||
| 134 | * @return SearchParams |
||
| 135 | */ |
||
| 136 | public function setParent($parent) { |
||
| 140 | |||
| 141 | |||
| 142 | public function isValid() { |
||
| 145 | } |