2525use MacFJA \RediSearch \Redis \Command \Option \FlagOption ;
2626use MacFJA \RediSearch \Redis \Command \Option \GroupedOption ;
2727use MacFJA \RediSearch \Redis \Command \Option \NamedOption ;
28- use MacFJA \RediSearch \Redis \Command \Option \NamelessOption ;
2928use MacFJA \RediSearch \Redis \Command \Option \WithPublicGroupedSetterTrait ;
3029
3130/**
3534 * @method TextFieldOption setNoStem(bool $active)
3635 * @method TextFieldOption setWeight(?float $weight)
3736 * @method TextFieldOption setPhonetic(?string $phonetic)
37+ * @method TextFieldOption setUnNormalizedSortable(bool $unNormalized)
3838 */
3939class TextFieldOption extends GroupedOption implements CreateCommandFieldOption
4040{
41+ use BaseCreateFieldOptionTrait;
4142 use WithPublicGroupedSetterTrait;
4243
4344 public function __construct ()
4445 {
45- parent ::__construct ([
46- 'field ' => new NamelessOption (null , '>=2.0.0 ' ),
47- 'type ' => new FlagOption ('TEXT ' , true , '>=2.0.0 ' ),
46+ parent ::__construct ($ this ->getConstructorOptions ('TEXT ' , [
4847 'no_stem ' => new FlagOption ('NOSTEM ' , false , '>=2.0.0 ' ),
4948 'weight ' => CustomValidatorOption::isNumeric (new NamedOption ('WEIGHT ' , null , '>=2.0.0 ' )),
5049 'phonetic ' => CustomValidatorOption::allowedValues (new NamedOption ('PHONETIC ' , null , '>=2.0.0 ' ), ['dm:en ' , 'dm:fr ' , 'dm:pt ' , 'dm:es ' ]),
51- 'sortable ' => new FlagOption ('SORTABLE ' , false , '>=2.0.0 ' ),
52- 'no_index ' => new FlagOption ('NOINDEX ' , false , '>=2.0.0 ' ),
53- ], ['field ' , 'type ' ], ['type ' ], '>=2.0.0 ' );
50+ ]), ['field ' , 'type ' ], ['type ' ], '>=2.0.0 ' );
5451 }
5552
5653 public function getFieldName (): string
@@ -63,6 +60,6 @@ public function getFieldName(): string
6360 */
6461 protected function publicSetter (): array
6562 {
66- return ['field ' , 'no_stem ' , 'weight ' , 'phonetic ' , 'sortable ' , 'no_index ' ];
63+ return ['field ' , 'no_stem ' , 'weight ' , 'phonetic ' , 'sortable ' , 'no_index ' , ' un_normalized_sortable ' ];
6764 }
6865}
0 commit comments