|
5 | 5 | namespace PDPhilip\Elasticsearch\Eloquent\Docs; |
6 | 6 |
|
7 | 7 | use Illuminate\Contracts\Pagination\LengthAwarePaginator; |
8 | | -use PDPhilip\Elasticsearch\Data\MetaDTO; |
| 8 | +use Illuminate\Pagination\Cursor; |
9 | 9 | use PDPhilip\Elasticsearch\Eloquent\Builder; |
10 | 10 | use PDPhilip\Elasticsearch\Eloquent\ElasticCollection; |
11 | 11 | use PDPhilip\Elasticsearch\Eloquent\Model; |
|
15 | 15 | * Query Builder Methods --------------------------------- |
16 | 16 | * |
17 | 17 | * @method static $this query() |
18 | | - * @method static Builder dslQuery() |
| 18 | + * @method static $this dslQuery() |
19 | 19 | *----------------------------------- |
20 | 20 | * @method static $this where($column, $operator = null, $value = null, $boolean = 'and', $options = []) |
21 | 21 | * @method static $this whereNot($column, $operator = null, $value = null, $boolean = 'and', $options = []) |
|
85 | 85 | * @method static $this whereTermExists($column, $boolean = 'and', $not = false) |
86 | 86 | * @method static $this whereNotTermExists($column) |
87 | 87 | * @method static $this orWhereTermExists($column) |
88 | | - * @method static $this orWhereNotTermExists($column) |
| 88 | + * @method static $this orWhereNotTermsExists($column) |
89 | 89 | *----------------------------------- |
90 | 90 | * @method static $this whereRaw($dsl, $bindings = [], $boolean = 'and', $options = []) |
91 | 91 | *=========================================== |
92 | 92 | * Full Text Search Methods |
93 | 93 | *=========================================== |
94 | | - * @method static $this searchTerm($query, mixed $columns = null, $options = []) |
95 | | - * @method static $this orSearchTerm($query, mixed $columns = null, $options = []) |
96 | | - * @method static $this searchNotTerm($query, mixed $columns = null, $options = []) |
97 | | - * @method static $this orSearchNotTerm($query, mixed $columns = null, $options = []) |
98 | | - *----------------------------------- |
99 | | - * @method static $this searchTermMost($query, mixed $columns = null, $options = []) |
100 | | - * @method static $this orSearchTermMost($query, mixed $columns = null, $options = []) |
101 | | - * @method static $this searchNotTermMost($query, mixed $columns = null, $options = []) |
102 | | - * @method static $this orSearchNotTermMost($query, mixed $columns = null, $options = []) |
103 | | - *----------------------------------- |
104 | | - * @method static $this searchTermCross($query, mixed $columns = null, $options = []) |
105 | | - * @method static $this orSearchTermCross($query, mixed $columns = null, $options = []) |
106 | | - * @method static $this searchNotTermCross($query, mixed $columns = null, $options = []) |
107 | | - * @method static $this orSearchNotTermCross($query, mixed $columns = null, $options = []) |
108 | | - *----------------------------------- |
109 | | - * @method static $this searchPhrase($phrase, mixed $columns = null, $options = []) |
110 | | - * @method static $this orSearchPhrase($phrase, mixed $columns = null, $options = []) |
111 | | - * @method static $this searchNotPhrase($phrase, mixed $columns = null, $options = []) |
112 | | - * @method static $this orSearchNotPhrase($phrase, mixed $columns = null, $options = []) |
113 | | - *----------------------------------- |
114 | | - * @method static $this searchPhrasePrefix($phrase, mixed $columns = null, $options = []) |
115 | | - * @method static $this orSearchPhrasePrefix($phrase, mixed $columns = null, $options = []) |
116 | | - * @method static $this searchNotPhrasePrefix($phrase, mixed $columns = null, $options = []) |
117 | | - * @method static $this orSearchNotPhrasePrefix($phrase, mixed $columns = null, $options = []) |
118 | | - *----------------------------------- |
119 | | - * @method static $this searchBoolPrefix($query, mixed $columns = null, $options = []) |
120 | | - * @method static $this orSearchBoolPrefix($query, mixed $columns = null, $options = []) |
121 | | - * @method static $this searchNotBoolPrefix($query, mixed $columns = null, $options = []) |
122 | | - * @method static $this orSearchNotBoolPrefix($query, mixed $columns = null, $options = []) |
123 | | - *----------------------------------- |
124 | | - * @method static $this searchFuzzy($query, mixed $columns = null, $options = []) |
125 | | - * @method static $this orSearchFuzzy($query, mixed $columns = null, $options = []) |
126 | | - * @method static $this searchNotFuzzy($query, mixed $columns = null, $options = []) |
127 | | - * @method static $this orSearchNotFuzzy($query, mixed $columns = null, $options = []) |
128 | | - *----------------------------------- |
129 | | - * @method static $this searchFuzzyPrefix($query, mixed $columns = null, $options = []) |
130 | | - * @method static $this orSearchFuzzyPrefix($query, mixed $columns = null, $options = []) |
131 | | - * @method static $this searchNotFuzzyPrefix($query, mixed $columns = null, $options = []) |
132 | | - * @method static $this orSearchNotFuzzyPrefix($query, mixed $columns = null, $options = []) |
133 | | - *----------------------------------- |
134 | | - * @method static $this searchQueryString(mixed $query, mixed $columns = null, $options = []) |
135 | | - * @method static $this orSearchQueryString(mixed $query, mixed $columns = null, $options = []) |
136 | | - * @method static $this searchNotQueryString(mixed $query, mixed $columns = null, $options = []) |
137 | | - * @method static $this orSearchNotQueryString(mixed $query, mixed $columns = null, $options = []) |
| 94 | + * @method static $this searchTerm($term, $fields = ['*'], $options = [], $boolean = 'and') |
| 95 | + * @method static $this orSearchTerm($term, $fields = ['*'], $options = []) |
| 96 | + * @method static $this searchNotTerm($term, $fields = ['*'], $options = []) |
| 97 | + * @method static $this orSearchNotTerm($term, $fields = ['*'], $options = []) |
| 98 | + *----------------------------------- |
| 99 | + * @method static $this searchTermMost($term, $fields = ['*'], $options = [], $boolean = 'and') |
| 100 | + * @method static $this orSearchTermMost($term, $fields = ['*'], $options = []) |
| 101 | + * @method static $this searchNotTermMost($term, $fields = ['*'], $options = []) |
| 102 | + * @method static $this orSearchNotTermMost($term, $fields = ['*'], $options = []) |
| 103 | + *----------------------------------- |
| 104 | + * @method static $this searchTermCross($term, $fields = ['*'], $options = [], $boolean = 'and') |
| 105 | + * @method static $this orSearchTermCross($term, $fields = ['*'], $options = []) |
| 106 | + * @method static $this searchNotTermCross($term, $fields = ['*'], $options = []) |
| 107 | + * @method static $this orSearchNotTermCross($term, $fields = ['*'], $options = []) |
| 108 | + *----------------------------------- |
| 109 | + * @method static $this searchPhrase($phrase, $fields = ['*'], $options = [], $boolean = 'and') |
| 110 | + * @method static $this orSearchPhrase($phrase, $fields = ['*'], $options = []) |
| 111 | + * @method static $this searchNotPhrase($phrase, $fields = ['*'], $options = []) |
| 112 | + * @method static $this orSearchNotPhrase($phrase, $fields = ['*'], $options = []) |
| 113 | + *----------------------------------- |
| 114 | + * @method static $this searchPhrasePrefix($phrase, $fields = ['*'], $options = [], $boolean = 'and') |
| 115 | + * @method static $this orSearchPhrasePrefix($phrase, $fields = ['*'], $options = []) |
| 116 | + * @method static $this searchNotPhrasePrefix($phrase, $fields = ['*'], $options = []) |
| 117 | + * @method static $this orSearchNotPhrasePrefix($phrase, $fields = ['*'], $options = []) |
| 118 | + *----------------------------------- |
| 119 | + * @method static $this searchBoolPrefix($phrase, $fields = ['*'], $options = [], $boolean = 'and') |
| 120 | + * @method static $this orSearchBoolPrefix($phrase, $fields = ['*'], $options = []) |
| 121 | + *----------------------------------- |
| 122 | + * @method static $this searchFuzzy($term, $fields = ['*'], $options = []) |
| 123 | + * @method static $this orSearchFuzzy($term, $fields = ['*'], $options = []) |
| 124 | + * @method static $this searchNotFuzzy($term, $fields = ['*'], $options = []) |
| 125 | + * @method static $this orSearchNotFuzzy($term, $fields = ['*'], $options = []) |
| 126 | + *----------------------------------- |
| 127 | + * @method static $this searchFuzzyPrefix($term, $fields = ['*'], $options = []) |
| 128 | + * @method static $this orSearchFuzzyPrefix($term, $fields = ['*'], $options = []) |
| 129 | + * @method static $this searchNotFuzzyPrefix($term, $fields = ['*'], $options = []) |
| 130 | + * @method static $this orSearchNotFuzzyPrefix($term, $fields = ['*'], $options = []) |
| 131 | + *----------------------------------- |
| 132 | + * @method static $this searchQueryString($query, $fields = null, $options = []) |
| 133 | + * @method static $this orSearchQueryString($query, $fields = null, $options = []) |
| 134 | + * @method static $this searchNotQueryString($query, $fields = null, $options = []) |
| 135 | + * @method static $this orSearchNotQueryString($query, $fields = null, $options = []) |
138 | 136 | *=========================================== |
139 | | - * Specialty Methods |
| 137 | + * Speciality methods |
140 | 138 | *=========================================== |
141 | | - * @method static $this whereScript(string $script, array $options = [], $boolean = 'and') |
142 | | - * @method static $this orWhereScript(string $script, array $options = []) |
| 139 | + * @method static $this whereScript($script, $options = [], $boolean = 'and') |
| 140 | + * @method static $this orWhereScript($script, $options = []) |
143 | 141 | *----------------------------------- |
144 | | - * @method static $this highlight($columns = ['*'], $preTag = '<em>', $postTag = '</em>', array $options = []) |
| 142 | + * @method static $this highlight($fields = [], $preTag = '<em>', $postTag = '</em>', $globalOptions = []) |
| 143 | + * @method static $this withoutRefresh() |
145 | 144 | *----------------------------------- |
146 | | - * @method static $this whereChild(string $documentType, \Closure $callback, $options = [], $boolean = 'and') |
147 | | - * @method static $this whereParent(string $documentType, \Closure $callback, $options = [], $boolean = 'and') |
148 | | - * @method static $this whereParentId(string $parentType, $id, string $boolean = 'and') |
| 145 | + * @method static $this whereChild($documentType, $callback, $options = [], $boolean = 'and') |
| 146 | + * @method static $this whereParent($documentType, $callback, $options = [], $boolean = 'and') |
| 147 | + * @method static $this whereParentId($parentType, $id, $boolean = 'and') |
149 | 148 | *----------------------------------- |
150 | | - * @method static $this excludeFields(string|array $fields) |
151 | | - * @method static $this withAnalyzer(string $analyzer) |
152 | | - * @method static $this withMinScore(float $val) |
| 149 | + * @method static $this excludeFields($fields) |
| 150 | + * @method static $this withAnalyzer($analyzer) |
| 151 | + * @method static $this withMinScore($val) |
153 | 152 | * @method static $this withSuffix($suffix) |
154 | | - * @method static $this withTrackTotalHits(bool|int|null $val = true) |
155 | | - * @method static $this withoutTrackTotalHits() |
156 | 153 | *----------------------------------- |
157 | | - * @method static $this routing(string $routing) |
158 | | - * @method static $this parentId(string $id) |
| 154 | + * @method static $this routing($routing) |
| 155 | + * @method static $this parentId($id) |
159 | 156 | *----------------------------------- |
160 | 157 | * @method static $this proceedOnConflicts() |
161 | | - * @method static $this onConflicts(string $option = 'proceed') |
| 158 | + * @method static $this onConflicts($option = 'proceed') |
162 | 159 | *----------------------------------- |
163 | | - * @method static Model withoutRefresh() |
164 | | - * @method static Model withRefresh(bool|string $refresh) |
165 | | - * @method static Model withOpType(string $value) |
166 | | - * @method static Model createOnly() |
| 160 | + * @method static $this push($column, $value = null, $unique = false) |
| 161 | + * @method static $this pull($column, $value = null) |
167 | 162 | *----------------------------------- |
168 | | - * @method static int push(string $column, $value = null, $unique = false) |
169 | | - * @method static int pull(string $column, $value = null) |
170 | | - *----------------------------------- |
171 | | - * @method static int incrementEach($columns, $extra = []) |
172 | | - * @method static int decrementEach($columns, $extra = []) |
| 163 | + * @method static $this incrementEach($columns, $extra = []) |
| 164 | + * @method static $this decrementEach($columns, $extra = []) |
173 | 165 | *=========================================== |
174 | | - * Filter and Order Methods |
| 166 | + * Filter and order methods |
175 | 167 | *=========================================== |
176 | | - * @method static $this orderBy($column, $direction = 1, array $options = []) |
177 | | - * @method static $this orderByDesc($column, array $options = []) |
| 168 | + * @method static $this orderBy($column, $direction = 'asc',$options = []) |
| 169 | + * @method static $this orderByDesc($column,$options = []) |
178 | 170 | *----------------------------------- |
179 | | - * @method static $this groupBy(...$groups) |
180 | | - * @method static $this groupByRanges($column, $ranges = []) |
181 | | - * @method static $this groupByDateRanges($column, $ranges = [], $options = []) |
| 171 | + * @method static $this groupBy($groups) |
| 172 | + * @method static $this groupByRanges($column, array $ranges) |
| 173 | + * @method static $this groupByDateRanges($column, array $ranges, array $options = []) |
182 | 174 | *----------------------------------- |
183 | | - * @method static $this orderByGeo(string $column, array $coordinates, $direction = 1, array $options = []) |
184 | | - * @method static $this orderByGeoDesc(string $column, array $coordinates, array $options = []) |
| 175 | + * @method static $this orderByGeo($column, $pin, $direction = 'asc', $options = []) |
| 176 | + * @method static $this orderByGeoDesc($column, $pin, $options = []) |
185 | 177 | *----------------------------------- |
186 | | - * @method static $this orderByNested(string $column, $direction = 1, string $mode = 'avg') |
187 | | - * @method static $this orderByNestedDesc(string $column, string $mode = 'avg') |
| 178 | + * @method static $this orderByNested($column, $direction = 'asc', $mode = null) |
| 179 | + * @method static $this orderByNestedDesc($column, $direction = 'asc', $mode = null) |
188 | 180 | *----------------------------------- |
189 | | - * @method static $this withSort(string $column, $key, $value) |
| 181 | + * @method static $this withSort($column, $key, $value) |
| 182 | + * @method static $this withRefresh($type) |
190 | 183 | *=========================================== |
191 | 184 | * Executors |
192 | 185 | *=========================================== |
193 | 186 | * @method static Model|null find($id) |
194 | 187 | * @method static Model|null first($columns = ['*']) |
195 | 188 | * @method static Model firstOrCreate($attributes, $values = []) |
196 | | - * @method static Model createOrFail(array $attributes) |
197 | 189 | *----------------------------------- |
198 | 190 | * @method static array getModels($columns = ['*']) |
199 | 191 | * @method static ElasticCollection get($columns = ['*']) |
200 | | - * @method static MetaDTO|bool insert(array $values) |
201 | | - * @method static array bulkInsert(array $values) |
202 | | - * @method static int upsert(array $values, array|string $uniqueBy, ?array $update = null) |
203 | | - * @method static Model create(array $attributes) |
| 192 | + * @method static ElasticCollection insert($values, $returnData = null) |
| 193 | + * @method static $this create(array $attributes) |
| 194 | + * @method static $this createOnly() |
| 195 | + * @method static $this createOrFail(array $attributes) |
204 | 196 | *----------------------------------- |
205 | | - * @method static array|string toDsl() |
| 197 | + * @method static array toDsl($columns = ['*']) |
| 198 | + * @method static array toSql($columns = ['*']) |
206 | 199 | *----------------------------------- |
207 | | - * @method static ElasticCollection rawSearch($dslBody, $options = []) |
208 | | - * @method static array rawAggregation($dslBody, $options = []) |
209 | | - * @method static array rawDsl($dsl) |
| 200 | + * @method static mixed rawDsl($bodyParams) |
| 201 | + * @method static ElasticCollection rawSearch($bodyParams) |
| 202 | + * @method static array rawAggregation($bodyParams) |
210 | 203 | *----------------------------------- |
211 | | - * @method static LengthAwarePaginator paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null, $total = null) |
212 | | - * @method static SearchAfterPaginator cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) |
| 204 | + * @method static LengthAwarePaginator paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null, $total = null) |
| 205 | + * @method static SearchAfterPaginator cursorPaginate($perPage = null, $columns = [], $cursorName = 'cursor', $cursor = null) |
213 | 206 | *----------------------------------- |
214 | | - * @method static bool chunk($count, callable $callback, $scrollTimeout = '30s') |
| 207 | + * @method static bool chunk($count, $callback) |
215 | 208 | * @method static bool chunkById($count, $callback, $column = '_id', $alias = null) |
216 | 209 | *----------------------------------- |
217 | | - * @method static ElasticCollection distinct(mixed $columns = [], bool $includeCount = false) |
218 | | - * @method static ElasticCollection bulkDistinct(array $columns = [], bool $includeCount = false) |
| 210 | + * @method static ElasticCollection distinct($columns = [], $includeCount = false) |
| 211 | + * @method static ElasticCollection bulkDistinct($columns = [], $includeCount = false) |
219 | 212 | *=========================================== |
220 | | - * Aggregation Methods |
| 213 | + * Aggregators Methods |
221 | 214 | *=========================================== |
222 | | - * @method static int|array sum($column, array $options = []) |
223 | | - * @method static int|array min($column, array $options = []) |
224 | | - * @method static int|array max($column, array $options = []) |
225 | | - * @method static int|array avg($column, array $options = []) |
226 | | - * @method static mixed agg(array $functions, string|array $columns, array $options = []) |
227 | | - * @method static mixed aggregate($function, $columns = ['*'], $options = []) |
| 215 | + * @method static int|array sum($columns) |
| 216 | + * @method static int|array min($columns) |
| 217 | + * @method static int|array max($columns) |
| 218 | + * @method static int|array avg($columns) |
| 219 | + * @method static int|array average($columns) |
| 220 | + * @method static mixed agg(array $functions, $column) |
| 221 | + * @method static mixed aggregate(array $functions, $column) |
228 | 222 | *----------------------------------- |
229 | 223 | * @method static mixed boxplot($columns, $options = []) |
230 | 224 | * @method static mixed cardinality($columns, $options = []) |
|
237 | 231 | *----------------------------------- |
238 | 232 | * @method static array getAggregationResults() |
239 | 233 | * @method static array getRawAggregationResults() |
240 | | - * @method static mixed getGroupByAfterKey($offset) |
241 | 234 | *=========================================== |
242 | 235 | * Index Methods |
243 | 236 | *=========================================== |
244 | 237 | * @method static void truncate() |
245 | 238 | * @method static bool indexExists() |
246 | | - * @method static void deleteIndexIfExists() |
247 | | - * @method static void deleteIndex() |
248 | | - * @method static bool createIndex(?\Closure $callback = null) |
249 | | - * @method static array getIndexMappings(bool $raw = false) |
250 | | - * @method static array getFieldMappings(bool $raw = false) |
251 | | - * @method static array getFieldMapping(string|array $field = '*', bool $raw = false) |
252 | | - * @method static array getIndexSettings() |
253 | | - * @method static bool hasField(string $column) |
254 | | - * @method static bool hasFields(array $columns) |
| 239 | + * @method static bool deleteIndexIfExists() |
| 240 | + * @method static bool deleteIndex() |
| 241 | + * @method static bool createIndex($callback) |
| 242 | + * @method static array getIndexMappings() |
| 243 | + * @method static array getFieldMapping(string|array $field = '*', $raw = false) |
| 244 | + * @method static array getIndexOptions() |
255 | 245 | * |
256 | 246 | * @property object $search_highlights |
257 | 247 | * @property object $with_highlights |
|
0 commit comments