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

Commit 738b1ac

Browse files
author
tkostuch
committed
3948 disable loadByAttributeMetadata by default
1 parent e1eaaf7 commit 738b1ac

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

config/default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@
332332
"includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key" ]
333333
},
334334
"attribute": {
335-
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ]
335+
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ],
336+
"loadByAttributeMetadata": false
336337
},
337338
"productList": {
338339
"sort": "",

src/api/catalog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default ({config, db}) => async function (req, res, body) {
130130
resultProcessor.process(_resBody.hits.hits, groupId).then(async (result) => {
131131
_resBody.hits.hits = result
132132
_cacheStorageHandler(config, _resBody, reqHash, tagsArray)
133-
if (_resBody.aggregations) {
133+
if (_resBody.aggregations && config.entities.attribute.loadByAttributeMetadata) {
134134
const attributeListParam = AttributeService.transformAggsToAttributeListParam(_resBody.aggregations)
135135
// find attribute list
136136
const attributeList = await AttributeService.list(attributeListParam, config, indexName)

src/graphql/elasticsearch/catalog/resolver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function list (filter, sort, currentPage, pageSize, search, context, rootV
6969

7070
response.aggregations = esResponse.aggregations
7171

72-
if (response.aggregations) {
72+
if (response.aggregations && config.entities.attribute.loadByAttributeMetadata) {
7373
const attributeListParam = AttributeService.transformAggsToAttributeListParam(response.aggregations)
7474
const attributeList = await AttributeService.list(attributeListParam, config, esIndex)
7575
response.attribute_metadata = attributeList.map(AttributeService.transformToMetadata)

src/graphql/elasticsearch/catalog/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type Products @doc(description: "The Products object is the top-level object ret
77
total_count: Int @doc(description: "The number of products returned")
88
# filters: [LayerFilter] @doc(description: "Layered navigation filters array") // @TODO: add filters to response instead of aggregations
99
aggregations: JSON @doc(description: "Layered navigation filters array as aggregations")
10-
attribute_metadata: JSON @doc(description: "Transformed aggregations into attributes")
10+
attribute_metadata: JSON @doc(description: "Transformed aggregations into attributes - you need to allow 'config.entities.attribute.loadByAttributeMetadata'")
1111
sort_fields: SortFields @doc(description: "An object that includes the default sort field and all available sort fields")
1212
}
1313

0 commit comments

Comments
 (0)