Skip to content

Commit

Permalink
add new setting omitHeader;
Browse files Browse the repository at this point in the history
add debug output of Solr request URI
  • Loading branch information
cradeck committed Jul 31, 2023
1 parent 45e5f3c commit b656e24
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
13 changes: 11 additions & 2 deletions Classes/Service/SolrServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,19 @@ public function getDefaultQuery(): array
$this->signalSlotDispatcher->dispatch('Subugoe\Find\Controller\SearchController', 'indexActionBeforeRender', array(&$resultSet));
$this->timing['INDEX_AFTER_BeforeRender_SLOT'] = $this->timeTracker->getDifferenceToStarttime();

$this->timing['BEFORE_RENDER'] = $this->timing['INDEX_AFTER_BeforeRender_SLOT'];
return [
$assignments = [
'results' => $resultSet,
'error' => $error,
'timing' => $this->timing
];

// Add request URI to debug output.
if (array_key_exists('debug', $this->requestArguments)) {
$assignments['solrRequest'] = $this->connection->getEndpoint()->getBaseUri(). $resultSet->getQuery()->getRequestBuilder()->build($resultSet->getQuery())->getUri();
}

$this->timing['BEFORE_RENDER'] = $this->timing['INDEX_AFTER_BeforeRender_SLOT'];
return $assignments;
}
}

Expand Down Expand Up @@ -849,6 +856,8 @@ protected function createQuery(): void
$this->addTypoScriptFilters();
$this->addDefaultQueryOperator();

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

$this->setConfigurationValue('solarium', $this->query);
}

Expand Down
1 change: 1 addition & 0 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugin.tx_find {
}
}
}
omitHeader = true

nosearchRedirect =

Expand Down
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,24 @@ configure access to the Solr index. It contains:
- `timeout` \[5\]: number of seconds before a Solr request times out
- `scheme` \[http\]: URI scheme of the connection

1. Example:
```
plugin.tx_find.settings {
connections {
default {
provider = Subugoe\Find\Service\SolrServiceProvider
options {
host = 127.0.0.1
port = 8080
path = /solr/
timeout = 5
scheme = http
}
Example:

```
plugin.tx_find.settings {
connections {
default {
provider = Subugoe\Find\Service\SolrServiceProvider
options {
host = 127.0.0.1
port = 8080
path = /solr/
timeout = 5
scheme = http
}
}
}
```
}
```

### Solr Components

Expand All @@ -190,6 +191,16 @@ In case the Solr version is lower than 8, the setting
that is used (for instance 6 or 7). By default this is set to 8 and affects
a magic query prefix (see https://lucene.apache.org/solr/guide/6_6/the-extended-dismax-query-parser.html#TheExtendedDisMaxQueryParser-Usingthe_magicfields__val_and_query_).

### Omitting Solr headers

Solr headers can be disabled or enabled as required using the setting `omitHeader` \[true\].

Example:

```
plugin.tx_find.settings.omitHeader = false
```

### The search form

The `queryFields` setting configures the search form. It is a numbered
Expand Down

0 comments on commit b656e24

Please sign in to comment.