@@ -45,144 +45,144 @@ |
||
45 | 45 | final class SearchRequestSimpleQuery implements ISearchRequestSimpleQuery, JsonSerializable { |
46 | 46 | |
47 | 47 | |
48 | - /** @var int */ |
|
49 | - private $type = 0; |
|
50 | - |
|
51 | - /** @var string */ |
|
52 | - private $field = ''; |
|
53 | - |
|
54 | - /** @var array */ |
|
55 | - private $values = []; |
|
56 | - |
|
57 | - |
|
58 | - /** |
|
59 | - * SearchRequestQuery constructor. |
|
60 | - * |
|
61 | - * @param $type |
|
62 | - * @param $field |
|
63 | - * |
|
64 | - * @since 17.0.0 |
|
65 | - */ |
|
66 | - public function __construct(string $field, int $type) { |
|
67 | - $this->field = $field; |
|
68 | - $this->type = $type; |
|
69 | - } |
|
70 | - |
|
71 | - |
|
72 | - /** |
|
73 | - * Get the compare type of the query |
|
74 | - * |
|
75 | - * @return int |
|
76 | - * @since 17.0.0 |
|
77 | - */ |
|
78 | - public function getType(): int { |
|
79 | - return $this->type; |
|
80 | - } |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * Get the field to apply query |
|
85 | - * |
|
86 | - * @return string |
|
87 | - * @since 17.0.0 |
|
88 | - */ |
|
89 | - public function getField(): string { |
|
90 | - return $this->field; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Set the field to apply query |
|
95 | - * |
|
96 | - * @param string $field |
|
97 | - * |
|
98 | - * @return ISearchRequestSimpleQuery |
|
99 | - * @since 17.0.0 |
|
100 | - */ |
|
101 | - public function setField(string $field): ISearchRequestSimpleQuery { |
|
102 | - $this->field = $field; |
|
103 | - |
|
104 | - return $this; |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - /** |
|
109 | - * Get the value to compare (string) |
|
110 | - * |
|
111 | - * @return array |
|
112 | - * @since 17.0.0 |
|
113 | - */ |
|
114 | - public function getValues(): array { |
|
115 | - return $this->values; |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * Add value to compare (string) |
|
121 | - * |
|
122 | - * @param string $value |
|
123 | - * |
|
124 | - * @return ISearchRequestSimpleQuery |
|
125 | - * @since 17.0.0 |
|
126 | - */ |
|
127 | - public function addValue(string $value): ISearchRequestSimpleQuery { |
|
128 | - $this->values[] = $value; |
|
129 | - |
|
130 | - return $this; |
|
131 | - } |
|
132 | - |
|
133 | - /** |
|
134 | - * Add value to compare (int) |
|
135 | - * |
|
136 | - * @param int $value |
|
137 | - * |
|
138 | - * @return ISearchRequestSimpleQuery |
|
139 | - * @since 17.0.0 |
|
140 | - */ |
|
141 | - public function addValueInt(int $value): ISearchRequestSimpleQuery { |
|
142 | - $this->values[] = $value; |
|
143 | - |
|
144 | - return $this; |
|
145 | - } |
|
146 | - |
|
147 | - /** |
|
148 | - * Add value to compare (array) |
|
149 | - * |
|
150 | - * @param array $value |
|
151 | - * |
|
152 | - * @return ISearchRequestSimpleQuery |
|
153 | - * @since 17.0.0 |
|
154 | - */ |
|
155 | - public function addValueArray(array $value): ISearchRequestSimpleQuery { |
|
156 | - $this->values[] = $value; |
|
157 | - |
|
158 | - return $this; |
|
159 | - } |
|
160 | - |
|
161 | - /** |
|
162 | - * Add value to compare (bool) |
|
163 | - * |
|
164 | - * @param bool $value |
|
165 | - * |
|
166 | - * @return ISearchRequestSimpleQuery |
|
167 | - * @since 17.0.0 |
|
168 | - */ |
|
169 | - public function addValueBool(bool $value): ISearchRequestSimpleQuery { |
|
170 | - $this->values[] = $value; |
|
171 | - |
|
172 | - return $this; |
|
173 | - } |
|
174 | - |
|
175 | - |
|
176 | - /** |
|
177 | - * @return array|mixed |
|
178 | - * @since 17.0.0 |
|
179 | - */ |
|
180 | - public function jsonSerialize() { |
|
181 | - return [ |
|
182 | - 'type' => $this->getType(), |
|
183 | - 'field' => $this->getField(), |
|
184 | - 'values' => $this->getValues() |
|
185 | - ]; |
|
186 | - } |
|
48 | + /** @var int */ |
|
49 | + private $type = 0; |
|
50 | + |
|
51 | + /** @var string */ |
|
52 | + private $field = ''; |
|
53 | + |
|
54 | + /** @var array */ |
|
55 | + private $values = []; |
|
56 | + |
|
57 | + |
|
58 | + /** |
|
59 | + * SearchRequestQuery constructor. |
|
60 | + * |
|
61 | + * @param $type |
|
62 | + * @param $field |
|
63 | + * |
|
64 | + * @since 17.0.0 |
|
65 | + */ |
|
66 | + public function __construct(string $field, int $type) { |
|
67 | + $this->field = $field; |
|
68 | + $this->type = $type; |
|
69 | + } |
|
70 | + |
|
71 | + |
|
72 | + /** |
|
73 | + * Get the compare type of the query |
|
74 | + * |
|
75 | + * @return int |
|
76 | + * @since 17.0.0 |
|
77 | + */ |
|
78 | + public function getType(): int { |
|
79 | + return $this->type; |
|
80 | + } |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * Get the field to apply query |
|
85 | + * |
|
86 | + * @return string |
|
87 | + * @since 17.0.0 |
|
88 | + */ |
|
89 | + public function getField(): string { |
|
90 | + return $this->field; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Set the field to apply query |
|
95 | + * |
|
96 | + * @param string $field |
|
97 | + * |
|
98 | + * @return ISearchRequestSimpleQuery |
|
99 | + * @since 17.0.0 |
|
100 | + */ |
|
101 | + public function setField(string $field): ISearchRequestSimpleQuery { |
|
102 | + $this->field = $field; |
|
103 | + |
|
104 | + return $this; |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + /** |
|
109 | + * Get the value to compare (string) |
|
110 | + * |
|
111 | + * @return array |
|
112 | + * @since 17.0.0 |
|
113 | + */ |
|
114 | + public function getValues(): array { |
|
115 | + return $this->values; |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * Add value to compare (string) |
|
121 | + * |
|
122 | + * @param string $value |
|
123 | + * |
|
124 | + * @return ISearchRequestSimpleQuery |
|
125 | + * @since 17.0.0 |
|
126 | + */ |
|
127 | + public function addValue(string $value): ISearchRequestSimpleQuery { |
|
128 | + $this->values[] = $value; |
|
129 | + |
|
130 | + return $this; |
|
131 | + } |
|
132 | + |
|
133 | + /** |
|
134 | + * Add value to compare (int) |
|
135 | + * |
|
136 | + * @param int $value |
|
137 | + * |
|
138 | + * @return ISearchRequestSimpleQuery |
|
139 | + * @since 17.0.0 |
|
140 | + */ |
|
141 | + public function addValueInt(int $value): ISearchRequestSimpleQuery { |
|
142 | + $this->values[] = $value; |
|
143 | + |
|
144 | + return $this; |
|
145 | + } |
|
146 | + |
|
147 | + /** |
|
148 | + * Add value to compare (array) |
|
149 | + * |
|
150 | + * @param array $value |
|
151 | + * |
|
152 | + * @return ISearchRequestSimpleQuery |
|
153 | + * @since 17.0.0 |
|
154 | + */ |
|
155 | + public function addValueArray(array $value): ISearchRequestSimpleQuery { |
|
156 | + $this->values[] = $value; |
|
157 | + |
|
158 | + return $this; |
|
159 | + } |
|
160 | + |
|
161 | + /** |
|
162 | + * Add value to compare (bool) |
|
163 | + * |
|
164 | + * @param bool $value |
|
165 | + * |
|
166 | + * @return ISearchRequestSimpleQuery |
|
167 | + * @since 17.0.0 |
|
168 | + */ |
|
169 | + public function addValueBool(bool $value): ISearchRequestSimpleQuery { |
|
170 | + $this->values[] = $value; |
|
171 | + |
|
172 | + return $this; |
|
173 | + } |
|
174 | + |
|
175 | + |
|
176 | + /** |
|
177 | + * @return array|mixed |
|
178 | + * @since 17.0.0 |
|
179 | + */ |
|
180 | + public function jsonSerialize() { |
|
181 | + return [ |
|
182 | + 'type' => $this->getType(), |
|
183 | + 'field' => $this->getField(), |
|
184 | + 'values' => $this->getValues() |
|
185 | + ]; |
|
186 | + } |
|
187 | 187 | |
188 | 188 | } |
@@ -52,295 +52,295 @@ |
||
52 | 52 | interface ISearchRequest { |
53 | 53 | |
54 | 54 | |
55 | - /** |
|
56 | - * Get the maximum number of results to be returns by the Search Platform. |
|
57 | - * |
|
58 | - * @since 15.0.0 |
|
59 | - * |
|
60 | - * @return int |
|
61 | - */ |
|
62 | - public function getSize(): int; |
|
63 | - |
|
64 | - |
|
65 | - /** |
|
66 | - * Get the current page. |
|
67 | - * Used by pagination. |
|
68 | - * |
|
69 | - * @since 15.0.0 |
|
70 | - * |
|
71 | - * @return int |
|
72 | - */ |
|
73 | - public function getPage(): int; |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * Get the author of the request. |
|
78 | - * |
|
79 | - * @since 15.0.0 |
|
80 | - * |
|
81 | - * @return string |
|
82 | - */ |
|
83 | - public function getAuthor(): string; |
|
84 | - |
|
85 | - /** |
|
86 | - * Get the searched string. |
|
87 | - * |
|
88 | - * @since 15.0.0 |
|
89 | - * |
|
90 | - * @return string |
|
91 | - */ |
|
92 | - public function getSearch(): string; |
|
93 | - |
|
94 | - |
|
95 | - /** |
|
96 | - * Get the value of an option (as string). |
|
97 | - * |
|
98 | - * @since 15.0.0 |
|
99 | - * |
|
100 | - * @param string $option |
|
101 | - * @param string $default |
|
102 | - * |
|
103 | - * @return string |
|
104 | - */ |
|
105 | - public function getOption(string $option, string $default = ''): string; |
|
106 | - |
|
107 | - /** |
|
108 | - * Get the value of an option (as array). |
|
109 | - * |
|
110 | - * @since 15.0.0 |
|
111 | - * |
|
112 | - * @param string $option |
|
113 | - * @param array $default |
|
114 | - * |
|
115 | - * @return array |
|
116 | - */ |
|
117 | - public function getOptionArray(string $option, array $default = []): array; |
|
118 | - |
|
119 | - |
|
120 | - /** |
|
121 | - * Limit the search to a part of the document. |
|
122 | - * |
|
123 | - * @since 15.0.0 |
|
124 | - * |
|
125 | - * @param string $part |
|
126 | - * |
|
127 | - * @return ISearchRequest |
|
128 | - */ |
|
129 | - public function addPart(string $part): ISearchRequest; |
|
130 | - |
|
131 | - /** |
|
132 | - * Limit the search to an array of parts of the document. |
|
133 | - * |
|
134 | - * @since 15.0.0 |
|
135 | - * |
|
136 | - * @param array $parts |
|
137 | - * |
|
138 | - * @return ISearchRequest |
|
139 | - */ |
|
140 | - public function setParts(array $parts): ISearchRequest; |
|
141 | - |
|
142 | - /** |
|
143 | - * Get the parts the search is limited to. |
|
144 | - * |
|
145 | - * @since 15.0.0 |
|
146 | - * |
|
147 | - * @return array |
|
148 | - */ |
|
149 | - public function getParts(): array; |
|
150 | - |
|
151 | - |
|
152 | - /** |
|
153 | - * Limit the search to a specific meta tag. |
|
154 | - * |
|
155 | - * @since 15.0.0 |
|
156 | - * |
|
157 | - * @param string $tag |
|
158 | - * |
|
159 | - * @return ISearchRequest |
|
160 | - */ |
|
161 | - public function addMetaTag(string $tag): ISearchRequest; |
|
162 | - |
|
163 | - /** |
|
164 | - * Get the meta tags the search is limited to. |
|
165 | - * |
|
166 | - * @since 15.0.0 |
|
167 | - * |
|
168 | - * @return array |
|
169 | - */ |
|
170 | - public function getMetaTags(): array; |
|
171 | - |
|
172 | - /** |
|
173 | - * Limit the search to an array of meta tags. |
|
174 | - * |
|
175 | - * @since 15.0.0 |
|
176 | - * |
|
177 | - * @param array $tags |
|
178 | - * |
|
179 | - * @return ISearchRequest |
|
180 | - */ |
|
181 | - public function setMetaTags(array $tags): IsearchRequest; |
|
182 | - |
|
183 | - |
|
184 | - /** |
|
185 | - * Limit the search to a specific sub tag. |
|
186 | - * |
|
187 | - * @since 15.0.0 |
|
188 | - * |
|
189 | - * @param string $source |
|
190 | - * @param string $tag |
|
191 | - * |
|
192 | - * @return ISearchRequest |
|
193 | - */ |
|
194 | - public function addSubTag(string $source, string $tag): ISearchRequest; |
|
195 | - |
|
196 | - /** |
|
197 | - * Get the sub tags the search is limited to. |
|
198 | - * |
|
199 | - * @since 15.0.0 |
|
200 | - * |
|
201 | - * @param bool $formatted |
|
202 | - * |
|
203 | - * @return array |
|
204 | - */ |
|
205 | - public function getSubTags(bool $formatted): array; |
|
206 | - |
|
207 | - /** |
|
208 | - * Limit the search to an array of sub tags. |
|
209 | - * |
|
210 | - * @since 15.0.0 |
|
211 | - * |
|
212 | - * @param array $tags |
|
213 | - * |
|
214 | - * @return ISearchRequest |
|
215 | - */ |
|
216 | - public function setSubTags(array $tags): ISearchRequest; |
|
217 | - |
|
218 | - |
|
219 | - /** |
|
220 | - * Limit the search to a specific field of the mapping, using a full string. |
|
221 | - * |
|
222 | - * @since 15.0.0 |
|
223 | - * |
|
224 | - * @param string $field |
|
225 | - * |
|
226 | - * @return ISearchRequest |
|
227 | - */ |
|
228 | - public function addLimitField(string $field): ISearchRequest; |
|
229 | - |
|
230 | - /** |
|
231 | - * Get the fields the search is limited to. |
|
232 | - * |
|
233 | - * @since 15.0.0 |
|
234 | - * |
|
235 | - * @return array |
|
236 | - */ |
|
237 | - public function getLimitFields(): array; |
|
238 | - |
|
239 | - |
|
240 | - /** |
|
241 | - * Limit the search to a specific field of the mapping, using a wildcard on |
|
242 | - * the search string. |
|
243 | - * |
|
244 | - * @since 15.0.0 |
|
245 | - * |
|
246 | - * @param string $field |
|
247 | - * |
|
248 | - * @return ISearchRequest |
|
249 | - */ |
|
250 | - public function addWildcardField(string $field): ISearchRequest; |
|
251 | - |
|
252 | - /** |
|
253 | - * Get the limit to field of the mapping. |
|
254 | - * |
|
255 | - * @since 15.0.0 |
|
256 | - * |
|
257 | - * @return array |
|
258 | - */ |
|
259 | - public function getWildcardFields(): array; |
|
260 | - |
|
261 | - |
|
262 | - /** |
|
263 | - * Filter the results, based on a group of field, using regex |
|
264 | - * |
|
265 | - * @since 15.0.0 |
|
266 | - * |
|
267 | - * @param array $filters |
|
268 | - * |
|
269 | - * @return ISearchRequest |
|
270 | - */ |
|
271 | - public function addRegexFilters(array $filters): ISearchRequest; |
|
272 | - |
|
273 | - /** |
|
274 | - * Get the regex filters the search is limit to. |
|
275 | - * |
|
276 | - * @since 15.0.0 |
|
277 | - * |
|
278 | - * @return array |
|
279 | - */ |
|
280 | - public function getRegexFilters(): array; |
|
281 | - |
|
282 | - |
|
283 | - /** |
|
284 | - * Filter the results, based on a group of field, using wildcard |
|
285 | - * |
|
286 | - * @since 15.0.0 |
|
287 | - * |
|
288 | - * @param array $filter |
|
289 | - * |
|
290 | - * @return ISearchRequest |
|
291 | - */ |
|
292 | - public function addWildcardFilter(array $filter): ISearchRequest; |
|
293 | - |
|
294 | - /** |
|
295 | - * Get the wildcard filters the search is limit to. |
|
296 | - * |
|
297 | - * @since 15.0.0 |
|
298 | - * |
|
299 | - * @return array |
|
300 | - */ |
|
301 | - public function getWildcardFilters(): array; |
|
302 | - |
|
303 | - |
|
304 | - /** |
|
305 | - * Add an extra field to the search. |
|
306 | - * |
|
307 | - * @since 15.0.0 |
|
308 | - * |
|
309 | - * @param string $field |
|
310 | - * |
|
311 | - * @return ISearchRequest |
|
312 | - */ |
|
313 | - public function addField(string $field): ISearchRequest; |
|
314 | - |
|
315 | - /** |
|
316 | - * Get the list of extra field to search into. |
|
317 | - * |
|
318 | - * @since 15.0.0 |
|
319 | - * |
|
320 | - * @return array |
|
321 | - */ |
|
322 | - public function getFields(): array; |
|
323 | - |
|
324 | - |
|
325 | - |
|
326 | - /** |
|
327 | - * Add a MUST search on an extra field |
|
328 | - * |
|
329 | - * @param ISearchRequestSimpleQuery $query |
|
330 | - * |
|
331 | - * @return ISearchRequest |
|
332 | - * @since 17.0.0 |
|
333 | - */ |
|
334 | - public function addSimpleQuery(ISearchRequestSimpleQuery $query): ISearchRequest; |
|
335 | - |
|
336 | - |
|
337 | - /** |
|
338 | - * Get the list of queries on extra field. |
|
339 | - * |
|
340 | - * @return ISearchRequestSimpleQuery[] |
|
341 | - * @since 17.0.0 |
|
342 | - */ |
|
343 | - public function getSimpleQueries(): array; |
|
55 | + /** |
|
56 | + * Get the maximum number of results to be returns by the Search Platform. |
|
57 | + * |
|
58 | + * @since 15.0.0 |
|
59 | + * |
|
60 | + * @return int |
|
61 | + */ |
|
62 | + public function getSize(): int; |
|
63 | + |
|
64 | + |
|
65 | + /** |
|
66 | + * Get the current page. |
|
67 | + * Used by pagination. |
|
68 | + * |
|
69 | + * @since 15.0.0 |
|
70 | + * |
|
71 | + * @return int |
|
72 | + */ |
|
73 | + public function getPage(): int; |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * Get the author of the request. |
|
78 | + * |
|
79 | + * @since 15.0.0 |
|
80 | + * |
|
81 | + * @return string |
|
82 | + */ |
|
83 | + public function getAuthor(): string; |
|
84 | + |
|
85 | + /** |
|
86 | + * Get the searched string. |
|
87 | + * |
|
88 | + * @since 15.0.0 |
|
89 | + * |
|
90 | + * @return string |
|
91 | + */ |
|
92 | + public function getSearch(): string; |
|
93 | + |
|
94 | + |
|
95 | + /** |
|
96 | + * Get the value of an option (as string). |
|
97 | + * |
|
98 | + * @since 15.0.0 |
|
99 | + * |
|
100 | + * @param string $option |
|
101 | + * @param string $default |
|
102 | + * |
|
103 | + * @return string |
|
104 | + */ |
|
105 | + public function getOption(string $option, string $default = ''): string; |
|
106 | + |
|
107 | + /** |
|
108 | + * Get the value of an option (as array). |
|
109 | + * |
|
110 | + * @since 15.0.0 |
|
111 | + * |
|
112 | + * @param string $option |
|
113 | + * @param array $default |
|
114 | + * |
|
115 | + * @return array |
|
116 | + */ |
|
117 | + public function getOptionArray(string $option, array $default = []): array; |
|
118 | + |
|
119 | + |
|
120 | + /** |
|
121 | + * Limit the search to a part of the document. |
|
122 | + * |
|
123 | + * @since 15.0.0 |
|
124 | + * |
|
125 | + * @param string $part |
|
126 | + * |
|
127 | + * @return ISearchRequest |
|
128 | + */ |
|
129 | + public function addPart(string $part): ISearchRequest; |
|
130 | + |
|
131 | + /** |
|
132 | + * Limit the search to an array of parts of the document. |
|
133 | + * |
|
134 | + * @since 15.0.0 |
|
135 | + * |
|
136 | + * @param array $parts |
|
137 | + * |
|
138 | + * @return ISearchRequest |
|
139 | + */ |
|
140 | + public function setParts(array $parts): ISearchRequest; |
|
141 | + |
|
142 | + /** |
|
143 | + * Get the parts the search is limited to. |
|
144 | + * |
|
145 | + * @since 15.0.0 |
|
146 | + * |
|
147 | + * @return array |
|
148 | + */ |
|
149 | + public function getParts(): array; |
|
150 | + |
|
151 | + |
|
152 | + /** |
|
153 | + * Limit the search to a specific meta tag. |
|
154 | + * |
|
155 | + * @since 15.0.0 |
|
156 | + * |
|
157 | + * @param string $tag |
|
158 | + * |
|
159 | + * @return ISearchRequest |
|
160 | + */ |
|
161 | + public function addMetaTag(string $tag): ISearchRequest; |
|
162 | + |
|
163 | + /** |
|
164 | + * Get the meta tags the search is limited to. |
|
165 | + * |
|
166 | + * @since 15.0.0 |
|
167 | + * |
|
168 | + * @return array |
|
169 | + */ |
|
170 | + public function getMetaTags(): array; |
|
171 | + |
|
172 | + /** |
|
173 | + * Limit the search to an array of meta tags. |
|
174 | + * |
|
175 | + * @since 15.0.0 |
|
176 | + * |
|
177 | + * @param array $tags |
|
178 | + * |
|
179 | + * @return ISearchRequest |
|
180 | + */ |
|
181 | + public function setMetaTags(array $tags): IsearchRequest; |
|
182 | + |
|
183 | + |
|
184 | + /** |
|
185 | + * Limit the search to a specific sub tag. |
|
186 | + * |
|
187 | + * @since 15.0.0 |
|
188 | + * |
|
189 | + * @param string $source |
|
190 | + * @param string $tag |
|
191 | + * |
|
192 | + * @return ISearchRequest |
|
193 | + */ |
|
194 | + public function addSubTag(string $source, string $tag): ISearchRequest; |
|
195 | + |
|
196 | + /** |
|
197 | + * Get the sub tags the search is limited to. |
|
198 | + * |
|
199 | + * @since 15.0.0 |
|
200 | + * |
|
201 | + * @param bool $formatted |
|
202 | + * |
|
203 | + * @return array |
|
204 | + */ |
|
205 | + public function getSubTags(bool $formatted): array; |
|
206 | + |
|
207 | + /** |
|
208 | + * Limit the search to an array of sub tags. |
|
209 | + * |
|
210 | + * @since 15.0.0 |
|
211 | + * |
|
212 | + * @param array $tags |
|
213 | + * |
|
214 | + * @return ISearchRequest |
|
215 | + */ |
|
216 | + public function setSubTags(array $tags): ISearchRequest; |
|
217 | + |
|
218 | + |
|
219 | + /** |
|
220 | + * Limit the search to a specific field of the mapping, using a full string. |
|
221 | + * |
|
222 | + * @since 15.0.0 |
|
223 | + * |
|
224 | + * @param string $field |
|
225 | + * |
|
226 | + * @return ISearchRequest |
|
227 | + */ |
|
228 | + public function addLimitField(string $field): ISearchRequest; |
|
229 | + |
|
230 | + /** |
|
231 | + * Get the fields the search is limited to. |
|
232 | + * |
|
233 | + * @since 15.0.0 |
|
234 | + * |
|
235 | + * @return array |
|
236 | + */ |
|
237 | + public function getLimitFields(): array; |
|
238 | + |
|
239 | + |
|
240 | + /** |
|
241 | + * Limit the search to a specific field of the mapping, using a wildcard on |
|
242 | + * the search string. |
|
243 | + * |
|
244 | + * @since 15.0.0 |
|
245 | + * |
|
246 | + * @param string $field |
|
247 | + * |
|
248 | + * @return ISearchRequest |
|
249 | + */ |
|
250 | + public function addWildcardField(string $field): ISearchRequest; |
|
251 | + |
|
252 | + /** |
|
253 | + * Get the limit to field of the mapping. |
|
254 | + * |
|
255 | + * @since 15.0.0 |
|
256 | + * |
|
257 | + * @return array |
|
258 | + */ |
|
259 | + public function getWildcardFields(): array; |
|
260 | + |
|
261 | + |
|
262 | + /** |
|
263 | + * Filter the results, based on a group of field, using regex |
|
264 | + * |
|
265 | + * @since 15.0.0 |
|
266 | + * |
|
267 | + * @param array $filters |
|
268 | + * |
|
269 | + * @return ISearchRequest |
|
270 | + */ |
|
271 | + public function addRegexFilters(array $filters): ISearchRequest; |
|
272 | + |
|
273 | + /** |
|
274 | + * Get the regex filters the search is limit to. |
|
275 | + * |
|
276 | + * @since 15.0.0 |
|
277 | + * |
|
278 | + * @return array |
|
279 | + */ |
|
280 | + public function getRegexFilters(): array; |
|
281 | + |
|
282 | + |
|
283 | + /** |
|
284 | + * Filter the results, based on a group of field, using wildcard |
|
285 | + * |
|
286 | + * @since 15.0.0 |
|
287 | + * |
|
288 | + * @param array $filter |
|
289 | + * |
|
290 | + * @return ISearchRequest |
|
291 | + */ |
|
292 | + public function addWildcardFilter(array $filter): ISearchRequest; |
|
293 | + |
|
294 | + /** |
|
295 | + * Get the wildcard filters the search is limit to. |
|
296 | + * |
|
297 | + * @since 15.0.0 |
|
298 | + * |
|
299 | + * @return array |
|
300 | + */ |
|
301 | + public function getWildcardFilters(): array; |
|
302 | + |
|
303 | + |
|
304 | + /** |
|
305 | + * Add an extra field to the search. |
|
306 | + * |
|
307 | + * @since 15.0.0 |
|
308 | + * |
|
309 | + * @param string $field |
|
310 | + * |
|
311 | + * @return ISearchRequest |
|
312 | + */ |
|
313 | + public function addField(string $field): ISearchRequest; |
|
314 | + |
|
315 | + /** |
|
316 | + * Get the list of extra field to search into. |
|
317 | + * |
|
318 | + * @since 15.0.0 |
|
319 | + * |
|
320 | + * @return array |
|
321 | + */ |
|
322 | + public function getFields(): array; |
|
323 | + |
|
324 | + |
|
325 | + |
|
326 | + /** |
|
327 | + * Add a MUST search on an extra field |
|
328 | + * |
|
329 | + * @param ISearchRequestSimpleQuery $query |
|
330 | + * |
|
331 | + * @return ISearchRequest |
|
332 | + * @since 17.0.0 |
|
333 | + */ |
|
334 | + public function addSimpleQuery(ISearchRequestSimpleQuery $query): ISearchRequest; |
|
335 | + |
|
336 | + |
|
337 | + /** |
|
338 | + * Get the list of queries on extra field. |
|
339 | + * |
|
340 | + * @return ISearchRequestSimpleQuery[] |
|
341 | + * @since 17.0.0 |
|
342 | + */ |
|
343 | + public function getSimpleQueries(): array; |
|
344 | 344 | |
345 | 345 | } |
346 | 346 |
@@ -46,92 +46,92 @@ |
||
46 | 46 | interface ISearchRequestSimpleQuery { |
47 | 47 | |
48 | 48 | |
49 | - const COMPARE_TYPE_TEXT = 1; |
|
50 | - const COMPARE_TYPE_KEYWORD = 2; |
|
51 | - const COMPARE_TYPE_INT_EQ = 3; |
|
52 | - const COMPARE_TYPE_INT_GTE = 4; |
|
53 | - const COMPARE_TYPE_INT_GT = 5; |
|
54 | - const COMPARE_TYPE_INT_LTE = 6; |
|
55 | - const COMPARE_TYPE_INT_LT = 7; |
|
56 | - const COMPARE_TYPE_BOOL = 8; |
|
57 | - const COMPARE_TYPE_ARRAY = 9; |
|
58 | - |
|
59 | - |
|
60 | - /** |
|
61 | - * Get the compare type of the query |
|
62 | - * |
|
63 | - * @return int |
|
64 | - * @since 17.0.0 |
|
65 | - */ |
|
66 | - public function getType(): int; |
|
67 | - |
|
68 | - |
|
69 | - /** |
|
70 | - * Get the field to apply query |
|
71 | - * |
|
72 | - * @return string |
|
73 | - * @since 17.0.0 |
|
74 | - */ |
|
75 | - public function getField(): string; |
|
76 | - |
|
77 | - /** |
|
78 | - * Set the field to apply query |
|
79 | - * |
|
80 | - * @param string $field |
|
81 | - * |
|
82 | - * @return ISearchRequestSimpleQuery |
|
83 | - * @since 17.0.0 |
|
84 | - */ |
|
85 | - public function setField(string $field): ISearchRequestSimpleQuery; |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * Get the all values to compare |
|
90 | - * |
|
91 | - * @return array |
|
92 | - * @since 17.0.0 |
|
93 | - */ |
|
94 | - public function getValues(): array; |
|
95 | - |
|
96 | - /** |
|
97 | - * Add value to compare (string) |
|
98 | - * |
|
99 | - * @param string $value |
|
100 | - * |
|
101 | - * @return ISearchRequestSimpleQuery |
|
102 | - * @since 17.0.0 |
|
103 | - */ |
|
104 | - public function addValue(string $value): ISearchRequestSimpleQuery; |
|
105 | - |
|
106 | - /** |
|
107 | - * Add value to compare (int) |
|
108 | - * |
|
109 | - * @param int $value |
|
110 | - * |
|
111 | - * @return ISearchRequestSimpleQuery |
|
112 | - * @since 17.0.0 |
|
113 | - */ |
|
114 | - public function addValueInt(int $value): ISearchRequestSimpleQuery; |
|
115 | - |
|
116 | - /** |
|
117 | - * Add value to compare (array) |
|
118 | - * |
|
119 | - * @param array $value |
|
120 | - * |
|
121 | - * @return ISearchRequestSimpleQuery |
|
122 | - * @since 17.0.0 |
|
123 | - */ |
|
124 | - public function addValueArray(array $value): ISearchRequestSimpleQuery; |
|
125 | - |
|
126 | - /** |
|
127 | - * Add value to compare (bool) |
|
128 | - * |
|
129 | - * @param bool $value |
|
130 | - * |
|
131 | - * @return ISearchRequestSimpleQuery |
|
132 | - * @since 17.0.0 |
|
133 | - */ |
|
134 | - public function addValueBool(bool $value): ISearchRequestSimpleQuery; |
|
49 | + const COMPARE_TYPE_TEXT = 1; |
|
50 | + const COMPARE_TYPE_KEYWORD = 2; |
|
51 | + const COMPARE_TYPE_INT_EQ = 3; |
|
52 | + const COMPARE_TYPE_INT_GTE = 4; |
|
53 | + const COMPARE_TYPE_INT_GT = 5; |
|
54 | + const COMPARE_TYPE_INT_LTE = 6; |
|
55 | + const COMPARE_TYPE_INT_LT = 7; |
|
56 | + const COMPARE_TYPE_BOOL = 8; |
|
57 | + const COMPARE_TYPE_ARRAY = 9; |
|
58 | + |
|
59 | + |
|
60 | + /** |
|
61 | + * Get the compare type of the query |
|
62 | + * |
|
63 | + * @return int |
|
64 | + * @since 17.0.0 |
|
65 | + */ |
|
66 | + public function getType(): int; |
|
67 | + |
|
68 | + |
|
69 | + /** |
|
70 | + * Get the field to apply query |
|
71 | + * |
|
72 | + * @return string |
|
73 | + * @since 17.0.0 |
|
74 | + */ |
|
75 | + public function getField(): string; |
|
76 | + |
|
77 | + /** |
|
78 | + * Set the field to apply query |
|
79 | + * |
|
80 | + * @param string $field |
|
81 | + * |
|
82 | + * @return ISearchRequestSimpleQuery |
|
83 | + * @since 17.0.0 |
|
84 | + */ |
|
85 | + public function setField(string $field): ISearchRequestSimpleQuery; |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * Get the all values to compare |
|
90 | + * |
|
91 | + * @return array |
|
92 | + * @since 17.0.0 |
|
93 | + */ |
|
94 | + public function getValues(): array; |
|
95 | + |
|
96 | + /** |
|
97 | + * Add value to compare (string) |
|
98 | + * |
|
99 | + * @param string $value |
|
100 | + * |
|
101 | + * @return ISearchRequestSimpleQuery |
|
102 | + * @since 17.0.0 |
|
103 | + */ |
|
104 | + public function addValue(string $value): ISearchRequestSimpleQuery; |
|
105 | + |
|
106 | + /** |
|
107 | + * Add value to compare (int) |
|
108 | + * |
|
109 | + * @param int $value |
|
110 | + * |
|
111 | + * @return ISearchRequestSimpleQuery |
|
112 | + * @since 17.0.0 |
|
113 | + */ |
|
114 | + public function addValueInt(int $value): ISearchRequestSimpleQuery; |
|
115 | + |
|
116 | + /** |
|
117 | + * Add value to compare (array) |
|
118 | + * |
|
119 | + * @param array $value |
|
120 | + * |
|
121 | + * @return ISearchRequestSimpleQuery |
|
122 | + * @since 17.0.0 |
|
123 | + */ |
|
124 | + public function addValueArray(array $value): ISearchRequestSimpleQuery; |
|
125 | + |
|
126 | + /** |
|
127 | + * Add value to compare (bool) |
|
128 | + * |
|
129 | + * @param bool $value |
|
130 | + * |
|
131 | + * @return ISearchRequestSimpleQuery |
|
132 | + * @since 17.0.0 |
|
133 | + */ |
|
134 | + public function addValueBool(bool $value): ISearchRequestSimpleQuery; |
|
135 | 135 | |
136 | 136 | } |
137 | 137 |