From 8df169428865405b6afd933bab2ccdd30c32d51e Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 21 Jan 2010 22:03:02 +0000 Subject: [PATCH] - added options to switch on/off search domains (text, image, audio, video, app) - more memory by default git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6605 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- defaults/yacy.init | 7 +++++++ htroot/index.html | 10 +++++----- htroot/index.java | 15 ++++++++++----- htroot/yacysearch.html | 19 +++++++------------ htroot/yacysearch.java | 23 ++++++++++++++--------- startYACY.bat | 2 +- startYACY.sh | 2 +- 7 files changed, 45 insertions(+), 33 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 7b8326b45..f75defa3c 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -702,6 +702,13 @@ indexer.slots = 100 # maximum size of stacker queue stacker.slots = 2000 +# search domains. If set to false then that search is not available +search.text = true +search.images = true +search.audio = true +search.video = true +search.app = true + # number of search results displayed by default search.items = 10 diff --git a/htroot/index.html b/htroot/index.html index 841c17e53..fbffd82d1 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -30,11 +30,11 @@
-    -    -    -    - + #(searchtext)#::  #(/searchtext)# + #(searchimage)#::  #(/searchimage)# + #(searchaudio)#::  #(/searchaudio)# + #(searchvideo)#::  #(/searchvideo)# + #(searchapp)#::#(/searchapp)#
#(searchoptions)# diff --git a/htroot/index.java b/htroot/index.java index e3a287651..d2ec7ddbf 100644 --- a/htroot/index.java +++ b/htroot/index.java @@ -120,11 +120,16 @@ public class index { prop.put("display", display); prop.putHTML("constraint", constraint); prop.put("searchoptions_display", display); - prop.put("contentdomCheckText", (contentdom == ContentDomain.TEXT) ? "1" : "0"); - prop.put("contentdomCheckAudio", (contentdom == ContentDomain.AUDIO) ? "1" : "0"); - prop.put("contentdomCheckVideo", (contentdom == ContentDomain.VIDEO) ? "1" : "0"); - prop.put("contentdomCheckImage", (contentdom == ContentDomain.IMAGE) ? "1" : "0"); - prop.put("contentdomCheckApp", (contentdom == ContentDomain.APP) ? "1" : "0"); + prop.put("searchtext", sb.getConfigBool("search.text", true) ? 1 : 0); + prop.put("searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0); + prop.put("searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0); + prop.put("searchimage", sb.getConfigBool("search.image", true) ? 1 : 0); + prop.put("searchapp", sb.getConfigBool("search.app", true) ? 1 : 0); + prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0"); + prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0"); + prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0"); + prop.put("searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0"); + prop.put("searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0"); // online caution timing sb.localSearchLastAccess = System.currentTimeMillis(); diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 2394467ab..42d41897a 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -69,18 +69,13 @@ $(function() {
- -    - -    - -    - -    - - -   - more options + #(searchtext)#::  #(/searchtext)# + #(searchimage)#::  #(/searchimage)# + #(searchaudio)#::  #(/searchaudio)# + #(searchvideo)#::  #(/searchvideo)# + #(searchapp)#::#(/searchapp)# +   + more options
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 24ee6c40a..011de6ce7 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -202,10 +202,10 @@ public class yacysearch { if (clustersearch) global = true; // switches search on, but search target is limited to cluster nodes // find search domain - final ContentDomain contentdomCode = ContentDomain.contentdomParser((post == null ? "text" : post.get("contentdom", "text"))); + final ContentDomain contentdom = ContentDomain.contentdomParser((post == null ? "text" : post.get("contentdom", "text"))); // patch until better search profiles are available - if ((contentdomCode != ContentDomain.TEXT) && (itemsPerPage <= 32)) itemsPerPage = 64; + if ((contentdom != ContentDomain.TEXT) && (itemsPerPage <= 32)) itemsPerPage = 64; // check the search tracker TreeSet trackerHandles = sb.localSearchTracker.get(client); @@ -442,7 +442,7 @@ public class yacysearch { tenant, maxDistance, prefermask, - contentdomCode, + contentdom, language, navigation, fetchSnippets, @@ -624,7 +624,7 @@ public class yacysearch { prop.put("results_" + i + "_display", display); } prop.put("results", theQuery.displayResults()); - prop.put("resultTable", (contentdomCode == ContentDomain.APP || contentdomCode == ContentDomain.AUDIO || contentdomCode == ContentDomain.VIDEO) ? 1 : 0); + prop.put("resultTable", (contentdom == ContentDomain.APP || contentdom == ContentDomain.AUDIO || contentdom == ContentDomain.VIDEO) ? 1 : 0); prop.put("eventID", theQuery.id(false)); // for bottomline // process result of search @@ -668,11 +668,16 @@ public class yacysearch { prop.put("constraint", (constraint == null) ? "" : constraint.exportB64()); prop.put("verify", (fetchSnippets) ? "true" : "false"); prop.put("contentdom", (post == null ? "text" : post.get("contentdom", "text"))); - prop.put("contentdomCheckText", (contentdomCode == ContentDomain.TEXT) ? "1" : "0"); - prop.put("contentdomCheckAudio", (contentdomCode == ContentDomain.AUDIO) ? "1" : "0"); - prop.put("contentdomCheckVideo", (contentdomCode == ContentDomain.VIDEO) ? "1" : "0"); - prop.put("contentdomCheckImage", (contentdomCode == ContentDomain.IMAGE) ? "1" : "0"); - prop.put("contentdomCheckApp", (contentdomCode == ContentDomain.APP) ? "1" : "0"); + prop.put("searchtext", sb.getConfigBool("search.text", true) ? 1 : 0); + prop.put("searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0); + prop.put("searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0); + prop.put("searchimage", sb.getConfigBool("search.image", true) ? 1 : 0); + prop.put("searchapp", sb.getConfigBool("search.app", true) ? 1 : 0); + prop.put("searchtext_check", (contentdom == ContentDomain.TEXT) ? "1" : "0"); + prop.put("searchaudio_check", (contentdom == ContentDomain.AUDIO) ? "1" : "0"); + prop.put("searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0"); + prop.put("searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0"); + prop.put("searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0"); // for RSS: don't HTML encode some elements prop.putXML("rss_query", originalquerystring); diff --git a/startYACY.bat b/startYACY.bat index b5eff28c6..e32f45504 100644 --- a/startYACY.bat +++ b/startYACY.bat @@ -14,7 +14,7 @@ For %%X in (lib/*.jar) Do Call %0 CPGEN lib\%%X REM Please change the "javastart" settings in the web-interface "Basic Configuration" -> "Advanced" set jmx= set jms= -set javacmd=-Xmx180m -Xms180m +set javacmd=-Xmx250m -Xms250m set priolvl=10 set priority=/BELOWNORMAL if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX diff --git a/startYACY.sh b/startYACY.sh index b336e2925..0df3ccad4 100755 --- a/startYACY.sh +++ b/startYACY.sh @@ -159,7 +159,7 @@ then # JAVA_ARGS="-$i $JAVA_ARGS"; # done else - JAVA_ARGS="-Xmx180m -Xms180m $JAVA_ARGS"; + JAVA_ARGS="-Xmx250m -Xms250m $JAVA_ARGS"; PORT="8080" fi