File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to ` elasticsearch-query-builder ` will be documented in this file.
4
4
5
+ ## 1.3.0 - 2021-08-06
6
+
7
+ - add ` PrefixQuery `
8
+
5
9
## 1.2.2 - 2021-07-29
6
10
7
11
- remove debug statements (again :facepalm : )
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Spatie \ElasticsearchQueryBuilder \Queries ;
4
+
5
+ class PrefixQuery implements Query
6
+ {
7
+ public static function create (
8
+ string $ field ,
9
+ string | int $ query
10
+ ): self {
11
+ return new self ($ field , $ query );
12
+ }
13
+
14
+ public function __construct (
15
+ protected string $ field ,
16
+ protected string | int $ query
17
+ ) {
18
+ }
19
+
20
+ public function toArray (): array
21
+ {
22
+ return [
23
+ 'prefix ' => [
24
+ $ this ->field => [
25
+ 'value ' => $ this ->query ,
26
+ ],
27
+ ],
28
+ ];
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments