-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Hilsonxhero/dev
chore : update core
- Loading branch information
Showing
14 changed files
with
195 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Hilsonxhero\ElasticVision\Domain\Query\QueryProperties; | ||
|
||
class TrackTotalHits implements QueryProperty | ||
{ | ||
/** @param int|bool $trackTotalHits */ | ||
private function __construct( | ||
private mixed $trackTotalHits, | ||
) { | ||
} | ||
|
||
public static function all(): self | ||
{ | ||
return new self(true); | ||
} | ||
|
||
public static function none(): self | ||
{ | ||
return new self(false); | ||
} | ||
|
||
public static function count(int $count): self | ||
{ | ||
return new self($count); | ||
} | ||
|
||
public function build(): array | ||
{ | ||
return [ | ||
'track_total_hits' => $this->trackTotalHits, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Hilsonxhero\ElasticVision\Domain\Syntax; | ||
|
||
class RegExp implements SyntaxInterface | ||
{ | ||
private string $field; | ||
|
||
private ?string $value; | ||
|
||
private string $flags; | ||
|
||
private bool $insensitive; | ||
|
||
public function __construct(string $field, string $value = null, string $flags = 'ALL', bool $insensitive = false) | ||
{ | ||
$this->field = $field; | ||
$this->value = $value; | ||
$this->flags = $flags; | ||
$this->insensitive = $insensitive; | ||
} | ||
|
||
public function build(): array | ||
{ | ||
return ['regexp' => [ | ||
$this->field => [ | ||
'value' => $this->value, | ||
'flags' => $this->flags, | ||
'case_insensitive' => $this->insensitive, | ||
], | ||
]]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.