Skip to content

Commit

Permalink
OmitHeader aktivierbar und Ausgabe der Request URI (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrode authored Jul 28, 2023
1 parent 04c45c9 commit b9e3c6d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function indexAction() {

$this->addQueryInformationAsJavaScript($this->requestArguments['q']);
$this->addStandardAssignments();
$this->addSolrRequestToDebug($resultSet);
}
}

Expand Down Expand Up @@ -559,6 +560,8 @@ private function createQuery ($arguments = array()) {

$this->createQueryComponents($query);

$query->setOmitHeader($this->settings['omitHeader']);

$this->configuration['solarium'] = $query;

return $this->configuration['solarium'];
Expand Down Expand Up @@ -1506,4 +1509,15 @@ public function redirectAction() {

}

/**
* Adds request uri to debug output.
*/
private function addSolrRequestToDebug($result) {

if (array_key_exists('debug', $this->requestArguments)) {
$this->view->assign('solrRequest', $this->solr->getEndpoint()->getBaseUri(). $result->getQuery()->getRequestBuilder()->build($result->getQuery())->getUri());
}

}

}
1 change: 1 addition & 0 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugin.tx_find {
timeout = {$plugin.tx_find.settings.connection.timeout}
scheme = {$plugin.tx_find.settings.connection.scheme}
}
omitHeader = true
queryFields {
0 {
id = default
Expand Down

0 comments on commit b9e3c6d

Please sign in to comment.