Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Added UI setting for strictness of content-type checking on media search

luccioman36a45b39059d
diff --git a/htroot/ConfigPortal_p.html b/htroot/ConfigPortal_p.html
index eafb39ccc..86c7bb4db 100644
--- a/htroot/ConfigPortal_p.html
+++ b/htroot/ConfigPortal_p.html
@@ -52,6 +52,19 @@
<input type="radio" name="search.options" value="false" #(search.options)#checked="checked"::#(/search.options)# />do not show Advanced Search
</dd>
+ <dt>Media Search</dt>
+ <dd>
+ <label>
+ <input type="radio" name="search.strictContentDom" value="false" #(search.strictContentDom)#checked="checked"::#(/search.strictContentDom)# />Extended
+ </label>
+ <label>
+ <input type="radio" name="search.strictContentDom" value="true" #(search.strictContentDom)#::checked="checked"#(/search.strictContentDom)# />Strict
+ </label>
+ <p>Control whether media search results are strictly limited to indexed documents matching exactly the desired content domain (images, videos or applications specific),
+ or extended to pages including such medias (provide generally more results, but eventually less relevant).
+ </p>
+ </dd>
+
<dt>Remote results resorting</dt>
<dd>
<label title="Remote results resorting can be triggered once the 'Refresh sorting' button (near the 'Search' button) becomes available.">
diff --git a/htroot/ConfigPortal_p.java b/htroot/ConfigPortal_p.java
index ca87241f1..4387cac1e 100644
--- a/htroot/ConfigPortal_p.java
+++ b/htroot/ConfigPortal_p.java
@@ -94,9 +94,15 @@ public class ConfigPortal_p {
final boolean oldJsResort = sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT);
final boolean newJsResort = post.getBoolean(SwitchboardConstants.SEARCH_JS_RESORT);
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
- cleanSearchCache = oldJsResort != newJsResort;
+ cleanSearchCache = cleanSearchCache || oldJsResort != newJsResort;
sb.setConfig(SwitchboardConstants.SEARCH_JS_RESORT, newJsResort);
+ final boolean oldStrictContentDom = sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT);
+ final boolean newStrictContentDom = post.getBoolean(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM);
+ /* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
+ cleanSearchCache = cleanSearchCache || oldStrictContentDom != newStrictContentDom;
+ sb.setConfig(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, newStrictContentDom);
+
sb.setConfig(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
post.getBoolean(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED));
@@ -163,9 +169,15 @@ public class ConfigPortal_p {
final boolean oldJsResort = sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT);
final boolean newJsResort = Boolean.parseBoolean(config.getProperty(SwitchboardConstants.SEARCH_JS_RESORT, String.valueOf(SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT)));
/* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
- cleanSearchCache = oldJsResort != newJsResort;
+ cleanSearchCache = cleanSearchCache || oldJsResort != newJsResort;
sb.setConfig(SwitchboardConstants.SEARCH_JS_RESORT, newJsResort);
+ final boolean oldStrictContentDom = sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT);
+ final boolean newStrictContentDom = Boolean.parseBoolean(config.getProperty(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, String.valueOf(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT)));
+ /* When this setting has changed we must clean up the search event cache as it affects how search results are retrieved */
+ cleanSearchCache = cleanSearchCache || oldStrictContentDom != newStrictContentDom;
+ sb.setConfig(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM, newStrictContentDom);
+
sb.setConfig(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
Boolean.parseBoolean(config.getProperty(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
String.valueOf(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED_DEFAULT))));
@@ -199,6 +211,9 @@ public class ConfigPortal_p {
prop.put(SwitchboardConstants.PUBLIC_SEARCHPAGE, sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, false) ? 1 : 0);
prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0);
prop.put(SwitchboardConstants.SEARCH_JS_RESORT, sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT) ? 1 : 0);
+ prop.put(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM,
+ sb.getConfigBool(SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM,
+ SwitchboardConstants.SEARCH_STRICT_CONTENT_DOM_DEFAULT) ? 1 : 0);
prop.put(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,
sb.getConfigBool(SwitchboardConstants.REMOTESEARCH_HTTPS_PREFERRED,