Commit 69768a8 1 parent e82cda0 commit 69768a8 Copy full SHA for 69768a8
File tree 10 files changed +69
-36
lines changed
packages/seal/src/Schema/Field
10 files changed +69
-36
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public function __construct(
27
27
public readonly bool $ searchable ,
28
28
public readonly bool $ filterable ,
29
29
public readonly bool $ sortable ,
30
+ public readonly bool $ facet ,
30
31
public readonly array $ options ,
31
32
) {
32
33
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public function __construct(
32
32
bool $ searchable = false ,
33
33
bool $ filterable = false ,
34
34
bool $ sortable = false ,
35
+ bool $ facet = false ,
35
36
array $ options = [],
36
37
) {
37
38
if ($ searchable ) { // @phpstan-ignore-line
@@ -44,6 +45,7 @@ public function __construct(
44
45
$ searchable ,
45
46
$ filterable ,
46
47
$ sortable ,
48
+ $ facet ,
47
49
$ options ,
48
50
);
49
51
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public function __construct(
32
32
bool $ searchable = false ,
33
33
bool $ filterable = false ,
34
34
bool $ sortable = false ,
35
+ bool $ facet = false ,
35
36
array $ options = [],
36
37
) {
37
38
if ($ searchable ) { // @phpstan-ignore-line
@@ -44,6 +45,7 @@ public function __construct(
44
45
$ searchable ,
45
46
$ filterable ,
46
47
$ sortable ,
48
+ $ facet ,
47
49
$ options ,
48
50
);
49
51
}
Original file line number Diff line number Diff line change @@ -32,19 +32,21 @@ public function __construct(
32
32
bool $ searchable = false ,
33
33
bool $ filterable = false ,
34
34
bool $ sortable = false ,
35
+ bool $ facet = false ,
35
36
array $ options = [],
36
37
) {
37
38
if ($ searchable ) { // @phpstan-ignore-line
38
39
throw new \InvalidArgumentException ('Searchability for FloatField is not yet implemented: https://github.com/php-cmsig/search/issues/97 ' );
39
40
}
40
41
41
42
parent ::__construct (
42
- $ name ,
43
- $ multiple ,
44
- $ searchable ,
45
- $ filterable ,
46
- $ sortable ,
47
- $ options ,
43
+ name: $ name ,
44
+ multiple: $ multiple ,
45
+ searchable: $ searchable ,
46
+ filterable: $ filterable ,
47
+ sortable: $ sortable ,
48
+ facet: $ facet ,
49
+ options: $ options ,
48
50
);
49
51
}
50
52
}
Original file line number Diff line number Diff line change 22
22
* ATTENTION: Different search engines support only one field for geopoint per index.
23
23
*
24
24
* @property false $searchable
25
+ * @property false $facet
25
26
*
26
27
* @readonly
27
28
*/
@@ -30,6 +31,7 @@ final class GeoPointField extends AbstractField
30
31
/**
31
32
* @param false $searchable
32
33
* @param false $multiple
34
+ * @param false $facet
33
35
* @param array<string, mixed> $options
34
36
*/
35
37
public function __construct (
@@ -38,19 +40,25 @@ public function __construct(
38
40
bool $ searchable = false ,
39
41
bool $ filterable = false ,
40
42
bool $ sortable = false ,
43
+ bool $ facet = false ,
41
44
array $ options = [],
42
45
) {
43
46
if ($ searchable ) { // @phpstan-ignore-line
44
47
throw new \InvalidArgumentException ('Searchability for GeoPointField is not yet implemented: https://github.com/php-cmsig/search/issues/97 ' );
45
48
}
46
49
50
+ if ($ facet ) { // @phpstan-ignore-line
51
+ throw new \InvalidArgumentException ('Facet for GeoPointField is not yet implemented: <TODO create issue> ' );
52
+ }
53
+
47
54
parent ::__construct (
48
- $ name ,
49
- $ multiple ,
50
- $ searchable ,
51
- $ filterable ,
52
- $ sortable ,
53
- $ options ,
55
+ name: $ name ,
56
+ multiple: $ multiple ,
57
+ searchable: $ searchable ,
58
+ filterable: $ filterable ,
59
+ sortable: $ sortable ,
60
+ facet: $ facet ,
61
+ options: $ options ,
54
62
);
55
63
}
56
64
}
Original file line number Diff line number Diff line change 20
20
* @property false $searchable
21
21
* @property true $filterable
22
22
* @property true $sortable
23
+ * @property false $facet
23
24
*
24
25
* @readonly
25
26
*/
@@ -33,6 +34,7 @@ public function __construct(string $name)
33
34
searchable: false ,
34
35
filterable: true ,
35
36
sortable: true ,
37
+ facet: false ,
36
38
options: [],
37
39
);
38
40
}
Original file line number Diff line number Diff line change @@ -32,19 +32,21 @@ public function __construct(
32
32
bool $ searchable = false ,
33
33
bool $ filterable = false ,
34
34
bool $ sortable = false ,
35
+ bool $ facet = false ,
35
36
array $ options = [],
36
37
) {
37
38
if ($ searchable ) { // @phpstan-ignore-line
38
39
throw new \InvalidArgumentException ('Searchability for IntegerField is not yet implemented: https://github.com/php-cmsig/search/issues/97 ' );
39
40
}
40
41
41
42
parent ::__construct (
42
- $ name ,
43
- $ multiple ,
44
- $ searchable ,
45
- $ filterable ,
46
- $ sortable ,
47
- $ options ,
43
+ name: $ name ,
44
+ multiple: $ multiple ,
45
+ searchable: $ searchable ,
46
+ filterable: $ filterable ,
47
+ sortable: $ sortable ,
48
+ facet: $ facet ,
49
+ options: $ options ,
48
50
);
49
51
}
50
52
}
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public function __construct(
33
33
$ searchable = false ;
34
34
$ filterable = false ;
35
35
$ sortable = false ;
36
+ $ facet = false ;
36
37
37
38
foreach ($ fields as $ field ) {
38
39
if ($ field ->searchable ) {
@@ -46,15 +47,20 @@ public function __construct(
46
47
if ($ field ->sortable ) {
47
48
$ sortable = true ;
48
49
}
50
+
51
+ if ($ field ->facet ) {
52
+ $ facet = true ;
53
+ }
49
54
}
50
55
51
56
parent ::__construct (
52
- $ name ,
53
- $ multiple ,
54
- $ searchable ,
55
- $ filterable ,
56
- $ sortable ,
57
- $ options ,
57
+ name: $ name ,
58
+ multiple: $ multiple ,
59
+ searchable: $ searchable ,
60
+ filterable: $ filterable ,
61
+ sortable: $ sortable ,
62
+ facet: $ facet ,
63
+ options: $ options ,
58
64
);
59
65
}
60
66
}
Original file line number Diff line number Diff line change @@ -29,15 +29,17 @@ public function __construct(
29
29
bool $ searchable = true ,
30
30
bool $ filterable = false ,
31
31
bool $ sortable = false ,
32
+ bool $ facet = false ,
32
33
array $ options = [],
33
34
) {
34
35
parent ::__construct (
35
- $ name ,
36
- $ multiple ,
37
- $ searchable ,
38
- $ filterable ,
39
- $ sortable ,
40
- $ options ,
36
+ name: $ name ,
37
+ multiple: $ multiple ,
38
+ searchable: $ searchable ,
39
+ filterable: $ filterable ,
40
+ sortable: $ sortable ,
41
+ facet: $ facet ,
42
+ options: $ options ,
41
43
);
42
44
}
43
45
}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public function __construct(
34
34
$ searchable = false ;
35
35
$ filterable = false ;
36
36
$ sortable = false ;
37
+ $ facet = false ;
37
38
38
39
foreach ($ types as $ fields ) {
39
40
foreach ($ fields as $ field ) {
@@ -48,16 +49,21 @@ public function __construct(
48
49
if ($ field ->sortable ) {
49
50
$ sortable = true ;
50
51
}
52
+
53
+ if ($ field ->facet ) {
54
+ $ facet = true ;
55
+ }
51
56
}
52
57
}
53
58
54
59
parent ::__construct (
55
- $ name ,
56
- $ multiple ,
57
- $ searchable ,
58
- $ filterable ,
59
- $ sortable ,
60
- $ options ,
60
+ name: $ name ,
61
+ multiple: $ multiple ,
62
+ searchable: $ searchable ,
63
+ filterable: $ filterable ,
64
+ sortable: $ sortable ,
65
+ facet: $ facet ,
66
+ options: $ options ,
61
67
);
62
68
}
63
69
}
You can’t perform that action at this time.
0 commit comments