Skip to content

Commit 8e15d93

Browse files
authored
Merge pull request #3813 from rbayet/feat-backport-request-container-getters
[Core] Backport request container getters
2 parents 9d520e6 + bccc7a8 commit 8e15d93

4 files changed

Lines changed: 30 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.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ public function isSpellchecked()
159159
return in_array($this->spellingType, $fuzzySpellingTypes);
160160
}
161161

162+
/**
163+
* {@inheritDoc}
164+
*/
165+
public function getSpellingType()
166+
{
167+
return $this->spellingType;
168+
}
169+
162170
/**
163171
* {@inheritDoc}
164172
*/

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
*

src/module-elasticsuite-core/Search/RequestInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public function getSortOrders();
5656
*/
5757
public function isSpellchecked();
5858

59+
/**
60+
* Get the request spelling type.
61+
*
62+
* @return string
63+
*/
64+
public function getSpellingType();
65+
5966
/**
6067
* Get the value of the track_total_hits parameter, if any.
6168
*

0 commit comments

Comments
 (0)