Skip to content

Commit 70900a5

Browse files
committed
Remove facet
1 parent 062bf2a commit 70900a5

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/Doctrine/Odm/Filter/AtlasSearchFilter.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function __construct(
3232
private readonly string $index = 'default',
3333
private readonly string $operator = 'text',
3434
private readonly string $term = 'must',
35-
private readonly ?array $facet = null,
3635
) {
3736
}
3837

@@ -49,19 +48,10 @@ public function apply(Builder $aggregationBuilder, string $resourceClass, ?Opera
4948
if (!isset($context['search'])) {
5049
$searchStage = $context['search']['stage'] = $aggregationBuilder->search();
5150
$searchStage->index($this->index);
52-
53-
if ($this->facet) {
54-
$searchStage->facet()
55-
->operator($compound = $searchStage->compound())
56-
->add(...$this->facet);
57-
} else {
58-
$compound = $context['search']['compound'] = $searchStage->compound();
59-
}
60-
$context['search']['compound'] = $compound;
61-
} else {
62-
$compound = $context['search']['compound'];
51+
$context['search']['compound'] = $searchStage->compound();
6352
}
6453

54+
$compound = $context['search']['compound'];
6555
$compound->{$this->term}();
6656

6757
switch ($this->operator) {

0 commit comments

Comments
 (0)