From b592ba018478457ea22c244f32be2e584f93bd09 Mon Sep 17 00:00:00 2001 From: Rudolf Batt Date: Tue, 12 May 2026 15:49:01 +0200 Subject: [PATCH 1/5] Add technical hint to avoid redirect loops --- docs/smartquery/user-stories.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/smartquery/user-stories.rst b/docs/smartquery/user-stories.rst index ac81e5f..4dab96b 100644 --- a/docs/smartquery/user-stories.rst +++ b/docs/smartquery/user-stories.rst @@ -15,6 +15,10 @@ Acceptance criteria - internal systems can access https://query.searchhub.io/ to perform the search phrase check - internal systems can access https://import.searchhub.io/ to send and receive data updates +Technical hint + - It is possible that search managers create redirects to filtered search result pages of that same query, for example "running shoes" are redirected to ``..?q=running+shoes&cat=Sports/Running``. + To avoid endless redirect loops, those redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + smartQuery Query Testing Support -------------------------------- From 56616edab7fee25dd12bcf6328e4c09404fa9aac Mon Sep 17 00:00:00 2001 From: Rudolf Batt Date: Tue, 12 May 2026 16:12:35 +0200 Subject: [PATCH 2/5] Add example to redirect hint + duplicate to separate story --- docs/smartquery/user-stories.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/smartquery/user-stories.rst b/docs/smartquery/user-stories.rst index 4dab96b..628249e 100644 --- a/docs/smartquery/user-stories.rst +++ b/docs/smartquery/user-stories.rst @@ -17,7 +17,12 @@ Acceptance criteria Technical hint - It is possible that search managers create redirects to filtered search result pages of that same query, for example "running shoes" are redirected to ``..?q=running+shoes&cat=Sports/Running``. - To avoid endless redirect loops, those redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. + To prevent this, all redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + Example: + - Set the Redirect Flag: A search query that is mapped to a redirect, must explicitly flagged. For example by appending ``&redirected=true`` to the request URL. + - System Behavior: At your smartQuery integration this flag must be used to skip using a potentially returned redirect. + - Using masterQuery: Even with the flag set, the masterQuery returned by smartQuery should still be used as the query that is sent to your search engine. smartQuery Query Testing Support @@ -75,12 +80,23 @@ Technical Guidance searchHub Redirects ------------------- +*This story is actually included in the standard smartQuery integration. However it can be used to split the integration into separate steps.* + Story As a search manager, I want users to be redirected to specific landing pages for certain queries based on the configurations set within searchHub. Acceptance criteria - When a query is configured for a redirect, users should be directed to the corresponding landing page or URL. +Technical hint + - It is possible that search managers create redirects to filtered search result pages of that same query, for example "running shoes" are redirected to ``..?q=running+shoes&cat=Sports/Running``. + The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. + To prevent this, all redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + Example: + - Set the Redirect Flag: A search query that is mapped to a redirect, must explicitly flagged. For example by appending ``&redirected=true`` to the request URL. + - System Behavior: At your smartQuery integration this flag must be used to skip using a potentially returned redirect. + - Using masterQuery: Even with the flag set, the masterQuery returned by smartQuery should still be used as the query that is sent to your search engine. + Allow Static IP Address for Redirect URL Monitoring --------------------------------------------------- From b9f85226d50cbb32056bd38f33ec43a236753c81 Mon Sep 17 00:00:00 2001 From: Rudolf Batt Date: Tue, 12 May 2026 16:15:39 +0200 Subject: [PATCH 3/5] Refine once more --- docs/smartquery/user-stories.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/smartquery/user-stories.rst b/docs/smartquery/user-stories.rst index 628249e..25d0e43 100644 --- a/docs/smartquery/user-stories.rst +++ b/docs/smartquery/user-stories.rst @@ -20,8 +20,8 @@ Technical hint The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. To prevent this, all redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. Example: - - Set the Redirect Flag: A search query that is mapped to a redirect, must explicitly flagged. For example by appending ``&redirected=true`` to the request URL. - - System Behavior: At your smartQuery integration this flag must be used to skip using a potentially returned redirect. + - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` to the request URL. + - System Behavior: At your smartQuery integration this flag must be used to skip a potentially returned redirect. - Using masterQuery: Even with the flag set, the masterQuery returned by smartQuery should still be used as the query that is sent to your search engine. From f2465d6bfb3cdf1db0af8adcc87ddeb86793cb9a Mon Sep 17 00:00:00 2001 From: Rudolf Batt Date: Wed, 13 May 2026 09:24:58 +0200 Subject: [PATCH 4/5] Change defined behaviour for redirected URL --- docs/smartquery/user-stories.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/smartquery/user-stories.rst b/docs/smartquery/user-stories.rst index 25d0e43..f23ba90 100644 --- a/docs/smartquery/user-stories.rst +++ b/docs/smartquery/user-stories.rst @@ -18,11 +18,10 @@ Acceptance criteria Technical hint - It is possible that search managers create redirects to filtered search result pages of that same query, for example "running shoes" are redirected to ``..?q=running+shoes&cat=Sports/Running``. The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. - To prevent this, all redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + To prevent this, all redirects should generally be flagged as "redirected" and handled again by smartQuery. Example: - - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` to the request URL. - - System Behavior: At your smartQuery integration this flag must be used to skip a potentially returned redirect. - - Using masterQuery: Even with the flag set, the masterQuery returned by smartQuery should still be used as the query that is sent to your search engine. + - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. + - System Behavior: At your smartQuery integration this flag must be used to skip the usage of smartQuery. smartQuery Query Testing Support @@ -91,11 +90,10 @@ Acceptance criteria Technical hint - It is possible that search managers create redirects to filtered search result pages of that same query, for example "running shoes" are redirected to ``..?q=running+shoes&cat=Sports/Running``. The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. - To prevent this, all redirects should generally be flagged as "redirected" and not used again by smartQuery. The returned masterQuery can still be used to map to the best query. + To prevent this, all redirects should generally be flagged as "redirected" and handled again by smartQuery. Example: - - Set the Redirect Flag: A search query that is mapped to a redirect, must explicitly flagged. For example by appending ``&redirected=true`` to the request URL. - - System Behavior: At your smartQuery integration this flag must be used to skip using a potentially returned redirect. - - Using masterQuery: Even with the flag set, the masterQuery returned by smartQuery should still be used as the query that is sent to your search engine. + - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. + - System Behavior: At your smartQuery integration this flag must be used to skip the usage of smartQuery. Allow Static IP Address for Redirect URL Monitoring From 7424ec23bf130000bcbf61ec0f4d57e6cc529634 Mon Sep 17 00:00:00 2001 From: Rudolf Batt Date: Wed, 13 May 2026 10:42:52 +0200 Subject: [PATCH 5/5] Fix strange sentence --- docs/smartquery/user-stories.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/smartquery/user-stories.rst b/docs/smartquery/user-stories.rst index f23ba90..fe8eef9 100644 --- a/docs/smartquery/user-stories.rst +++ b/docs/smartquery/user-stories.rst @@ -20,7 +20,7 @@ Technical hint The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. To prevent this, all redirects should generally be flagged as "redirected" and handled again by smartQuery. Example: - - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. + - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly be flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. - System Behavior: At your smartQuery integration this flag must be used to skip the usage of smartQuery. @@ -92,7 +92,7 @@ Technical hint The problem is that without a "safety switch," the system might receive a redirect-URL from smartQuery and try to redirect the user all over again, creating an infinite loop. To prevent this, all redirects should generally be flagged as "redirected" and handled again by smartQuery. Example: - - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. + - Set the Redirect Flag: When a search query is mapped to a redirect, that URL must explicitly be flagged: For example by appending ``&redirected=true`` or ``&sh=0`` to the request URL. - System Behavior: At your smartQuery integration this flag must be used to skip the usage of smartQuery.