From f646ae73dfc2a7bbe36df6d445fbf7c2025ff8f1 Mon Sep 17 00:00:00 2001 From: Ayke Halder Date: Mon, 19 Aug 2024 15:20:16 +0200 Subject: [PATCH] Introduce method to unset the query string This resolves https://github.com/TYPO3-Solr/ext-solr/issues/4135 --- Classes/Domain/Search/SearchRequest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Classes/Domain/Search/SearchRequest.php b/Classes/Domain/Search/SearchRequest.php index 8aca5485ef..3d5ddf88c7 100644 --- a/Classes/Domain/Search/SearchRequest.php +++ b/Classes/Domain/Search/SearchRequest.php @@ -444,6 +444,17 @@ public function setRawQueryString(string $rawQueryString = ''): SearchRequest return $this; } + /** + * Unsets the query string. + */ + public function removeQueryString(): SearchRequest + { + $this->stateChanged = true; + $path = $this->prefixWithNamespace('q'); + $this->argumentsAccessor->reset($path); + return $this; + } + /** * Returns the passed rawQueryString. */