Skip to content

Commit bccc7a8

Browse files
romainruaudrbayet
authored andcommitted
Allow to get if a container is fulltext or not
1 parent d44cc8c commit bccc7a8

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/module-elasticsuite-core/Api/Search/Request/ContainerConfigurationInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,11 @@ public function getAggregations($query = null, $filters = [], $queryFilters = []
9393
* @return int|bool
9494
*/
9595
public function getTrackTotalHits();
96+
97+
/**
98+
* Returns if the current request is a fulltext request.
99+
*
100+
* @return bool
101+
*/
102+
public function isFulltext() : bool;
96103
}

src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ public function getTrackTotalHits()
168168
return $this->readBaseConfigParam('track_total_hits');
169169
}
170170

171+
/**
172+
* {@inheritDoc}
173+
*/
174+
public function isFulltext() : bool
175+
{
176+
return (bool) filter_var($this->readBaseConfigParam('fulltext'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
177+
}
178+
171179
/**
172180
* Read configuration param from base config.
173181
*

0 commit comments

Comments
 (0)