Skip to content

Commit

Permalink
Add NotInCondition to Typesense Adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
ToshY committed Oct 15, 2024
1 parent 42497ba commit c2bf749
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/seal-typesense-adapter/src/TypesenseSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ private function recursiveResolveFilterConditions(Index $index, array $condition
$filters = [];

foreach ($conditions as $filter) {
if ($filter instanceof Condition\InCondition) {
$filter = $filter->createOrCondition();
}
$filter = match (true) {
$filter instanceof Condition\InCondition => $filter->createOrCondition(),
$filter instanceof Condition\NotInCondition => $filter->createAndCondition(),
default => $filter,
};

match (true) {
$filter instanceof Condition\IdentifierCondition => $filters[] = 'id:=' . $this->escapeFilterValue($filter->identifier),
Expand Down

0 comments on commit c2bf749

Please sign in to comment.