Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit dbb9913

Browse files
author
tkostuch
committed
add request_cache to ES url
1 parent d9cd852 commit dbb9913

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"review"
4141
],
4242
"apiVersion": "5.6",
43-
43+
"cacheRequest": false,
4444
"searchScoring": {
4545
"attributes": {
4646
"attribute_code": {

src/lib/elastic.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ function adjustBackendProxyUrl (req, indexName, entityType, config) {
5050
delete parsedQuery.request_format
5151
delete parsedQuery.response_format
5252
url = config.elasticsearch.host + ':' + config.elasticsearch.port + '/' + adjustIndexName(indexName, entityType, config) + '/_search?' + queryString.stringify(parsedQuery)
53+
54+
if (config.elasticsearch.cacheRequest) {
55+
url += `&request_cache=${!!config.elasticsearch.cacheRequest}`
56+
}
5357
}
5458
if (!url.startsWith('http')) {
5559
url = config.elasticsearch.protocol + '://' + url

0 commit comments

Comments
 (0)