From 96e62942ec8cbb68c24c104c45c80e48e9eb7044 Mon Sep 17 00:00:00 2001
From: esikkala <esko.ikkala@aalto.fi>
Date: Fri, 29 Jan 2021 09:35:38 +0200
Subject: [PATCH] Add new conf option:  noFilterForRelatedInstances

---
 src/server/sparql/FacetResults.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/server/sparql/FacetResults.js b/src/server/sparql/FacetResults.js
index 0ac32ab4..4b79a05e 100644
--- a/src/server/sparql/FacetResults.js
+++ b/src/server/sparql/FacetResults.js
@@ -215,11 +215,11 @@ export const getByURI = ({
   } else {
     ({ endpoint, langTag, langTagSecondary } = config)
   }
-  const { properties, relatedInstances } = config.instance
+  const { properties, relatedInstances, noFilterForRelatedInstances = false } = config.instance
   let q = instanceQuery
   q = q.replace('<PROPERTIES>', properties)
   q = q.replace('<RELATED_INSTANCES>', relatedInstances)
-  if (constraints == null) {
+  if (constraints == null || noFilterForRelatedInstances) {
     q = q.replace('<FILTER>', '# no filters')
   } else {
     q = q.replace('<FILTER>', generateConstraintsBlock({
-- 
GitLab