Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
adjusted ConfigHeuristic and changed QueryGoal.getOriginalQueryString to .getQueryString - since specific heuristic Twitter & Blekko is not longer available or redundant with OpenSearchHeuristic, adjusted ConfigHeuristic to use OpensearchHeuristic settings only. For this the default OSD search target list is made available (copied) by default and the other configs are removed.
reger97e84439fb74
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 618119cf9..393fcaf48 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -1060,8 +1060,6 @@ donation.iframetarget=env/donate.html# search heuristicsheuristic.site = false-heuristic.blekko = false-heuristic.twitter = falseheuristic.searchresults = falseheuristic.searchresults.crawlglobal = falseheuristic.opensearch = falsediff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.javaindex aaa42141a..a59840153 100644--- a/htroot/AccessTracker_p.java+++ b/htroot/AccessTracker_p.java@@ -170,7 +170,7 @@ public class AccessTracker_p {if (page == 2) {// local searchprop.putNum("page_list_" + m + "_offset", query.offset);- prop.putHTML("page_list_" + m + "_querystring", query.getQueryGoal().getOriginalQueryString(false));+ prop.putHTML("page_list_" + m + "_querystring", query.getQueryGoal().getQueryString(false));} else {// remote searchprop.putHTML("page_list_" + m + "_peername", (query.remotepeer == null) ? "<unknown>" : query.remotepeer.getName());diff --git a/htroot/ConfigHeuristics_p.html b/htroot/ConfigHeuristics_p.htmlindex 83b70b7e1..5d127c80b 100644--- a/htroot/ConfigHeuristics_p.html+++ b/htroot/ConfigHeuristics_p.html@@ -14,16 +14,16 @@</p><form action=""><fieldset>- The success of heuristics are marked with an image (<img width="16" height="9" src="/env/grafics/heuristic_redundant.gif" title="heuristic:<name> (redundant)" style="width:16px; height:9px;" alt="heuristic:<name> (redundant)"/>/<img width="16" height="9" src="/env/grafics/heuristic_new.gif" title="heuristic:<name> (new link)" style="width:16px; height:9px;" alt="heuristic:<name> (new link)"/>) below the favicon left from the search result entry:+ The success of heuristics are marked with an image (<img width="16" height="9" src="env/grafics/heuristic_redundant.gif" title="heuristic:<name> (redundant)" style="width:16px; height:9px;" alt="heuristic:<name> (redundant)"/>/<img width="16" height="9" src="env/grafics/heuristic_new.gif" title="heuristic:<name> (new link)" style="width:16px; height:9px;" alt="heuristic:<name> (new link)"/>) below the favicon left from the search result entry:<dl><dt>- <img width="16" height="9" src="/env/grafics/heuristic_redundant.gif" title="heuristic:<name> (redundant)" style="width:16px; height:9px;" alt="heuristic:<name> (redundant)"/>+ <img width="16" height="9" src="env/grafics/heuristic_redundant.gif" title="heuristic:<name> (redundant)" style="width:16px; height:9px;" alt="heuristic:<name> (redundant)"/></dt><dd>The search result was discovered by a heuristic, but the link was already known by YaCy</dd><dt>- <img width="16" height="9" src="/env/grafics/heuristic_new.gif" title="heuristic:<name> (new link)" style="width:16px; height:9px;" alt="heuristic:<name> (new link)"/>+ <img width="16" height="9" src="env/grafics/heuristic_new.gif" title="heuristic:<name> (new link)" style="width:16px; height:9px;" alt="heuristic:<name> (new link)"/></dt><dd>The search result was discovered by a heuristic, not previously known by YaCy@@ -70,33 +70,7 @@</p></fieldset></form>-- <form id="HeuristicFormTwitter" method="post" action="ConfigHeuristics_p.html" enctype="multipart/form-data" accept-charset="UTF-8">- <fieldset>- <legend>- <input type="checkbox" name="twitter_check" id="twitter" onclick="window.location.href='ConfigHeuristics_p.html?#(twitter.checked)#twitter_on=::twitter_off=#(/twitter.checked)#'" value="twitter"#(twitter.checked)#:: checked="checked"#(/twitter.checked)# />- <label for="twitter">twitter: load external search result list from <a href="http://search.twitter.com" target="_blank">twitter</a></label>- </legend>- <p>- When using this heuristic, then every search request line is used for a call to twitter.- 50 results are taken from twitter and loaded simultanously, parsed and indexed immediately.- </p>- </fieldset>- </form>-- <form id="HeuristicFormBlekko" method="post" action="ConfigHeuristics_p.html" enctype="multipart/form-data" accept-charset="UTF-8">- <fieldset>- <legend>- <input type="checkbox" name="blekko_check" id="blekko" onclick="window.location.href='ConfigHeuristics_p.html?#(blekko.checked)#blekko_on=::blekko_off=#(/blekko.checked)#'" value="blekko"#(blekko.checked)#:: checked="checked"#(/blekko.checked)# />- <label for="blekko">blekko: load external search result list from <a href="http://blekko.com" target="_blank">blekko</a></label>- </legend>- <p>- When using this heuristic, then every search request line is used for a call to blekko.- 20 results are taken from blekko and loaded simultanously, parsed and indexed immediately.- </p>- </fieldset>- </form>-+<fieldset><form id="HeuristicFormOpenSearch" method="post" action="ConfigHeuristics_p.html" enctype="multipart/form-data" accept-charset="UTF-8"><legend>@@ -137,10 +111,13 @@<td><input type="text" name="ossys_newurl" size="70"/></td><td><input type="submit" name="addnewosd" value="add"/></td></tr>+ <tr>+ <td colspan="3" style="padding-top:10px "><input type="submit" name="setopensearch" value="Save" class="submitready"/></td>+ <td colspan="2" align="center" style="padding-top:10px "><input type="submit" name="resettodefaultosdlist" value="reset to default list" class="submitready"/></td>+ </tr></table></div><div>- <input type="submit" name="setopensearch" value="Save" class="submitready"/><span style="color:red">#[osderrmsg]#</span></div><br>diff --git a/htroot/ConfigHeuristics_p.java b/htroot/ConfigHeuristics_p.javaindex 0c7fe7062..0f0cfa6ee 100644--- a/htroot/ConfigHeuristics_p.java+++ b/htroot/ConfigHeuristics_p.java@@ -61,10 +61,6 @@ public class ConfigHeuristics_p {if (post.containsKey("searchresult_off")) sb.setConfig(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false);if (post.containsKey("searchresultglobal_on")) sb.setConfig(SwitchboardConstants.HEURISTIC_SEARCHRESULTS_CRAWLGLOBAL, true);if (post.containsKey("searchresultglobal_off")) sb.setConfig(SwitchboardConstants.HEURISTIC_SEARCHRESULTS_CRAWLGLOBAL, false);- if (post.containsKey("blekko_on")) sb.setConfig(SwitchboardConstants.HEURISTIC_BLEKKO, true);- if (post.containsKey("blekko_off")) sb.setConfig(SwitchboardConstants.HEURISTIC_BLEKKO, false);- if (post.containsKey("twitter_on")) sb.setConfig(SwitchboardConstants.HEURISTIC_TWITTER, true);- if (post.containsKey("twitter_off")) sb.setConfig(SwitchboardConstants.HEURISTIC_TWITTER, false);if (post.containsKey("opensearch_on")) {sb.setConfig(SwitchboardConstants.HEURISTIC_OPENSEARCH, true);// re-read config (and create work table)@@ -137,11 +133,11 @@ public class ConfigHeuristics_p {}// copy default opensearch heuristic config with sample entries- if (post.containsKey("copydefaultosdconfig")) {+ if (post.containsKey("copydefaultosdconfig") || post.containsKey("resettodefaultosdlist")) {// prepare a solr index profile switch listfinal File osdDefaultConfig = new File(sb.getDataPath(), "defaults/heuristicopensearch.conf");final File osdConfig = new File(sb.getDataPath(), "DATA/SETTINGS/heuristicopensearch.conf");- if (!osdConfig.exists() && osdDefaultConfig.exists()) {+ if ((post.containsKey("resettodefaultosdlist") || !osdConfig.exists()) && osdDefaultConfig.exists()) {try {Files.copy(osdDefaultConfig, osdConfig);} catch (final IOException ex) {@@ -158,8 +154,6 @@ public class ConfigHeuristics_p {prop.put("site.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_SITE, false) ? 1 : 0);prop.put("searchresult.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) ? 1 : 0);prop.put("searchresultglobal.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS_CRAWLGLOBAL, false) ? 1 : 0);- prop.put("blekko.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_BLEKKO, false) ? 1 : 0);- prop.put("twitter.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_TWITTER, false) ? 1 : 0);prop.put("opensearch.checked", sb.getConfigBool(SwitchboardConstants.HEURISTIC_OPENSEARCH, false) ? 1 : 0);// display config file contentdiff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.javaindex cfc66a097..42ef47a7d 100644--- a/htroot/ConfigNetwork_p.java+++ b/htroot/ConfigNetwork_p.java@@ -93,8 +93,7 @@ public class ConfigNetwork_pif ( !indexReceive ) {// remove heuristicssb.setConfig(SwitchboardConstants.HEURISTIC_SITE, false);- sb.setConfig(SwitchboardConstants.HEURISTIC_BLEKKO, false);- sb.setConfig(SwitchboardConstants.HEURISTIC_TWITTER, false);+ sb.setConfig(SwitchboardConstants.HEURISTIC_OPENSEARCH, false);}final boolean robinsonmode = "robinson".equals(post.get("network", ""));if ( robinsonmode ) {diff --git a/htroot/api/timeline.java b/htroot/api/timeline.javaindex ce068ecf6..f96cf08ea 100644--- a/htroot/api/timeline.java+++ b/htroot/api/timeline.java@@ -67,7 +67,7 @@ public final class timeline {language = (agent == null) ? "en" : ISO639.userAgentLanguageDetection(agent);if (language == null) language = "en";}- final QueryGoal qg = new QueryGoal(querystring, querystring);+ final QueryGoal qg = new QueryGoal(querystring);HandleSet q = qg.getIncludeHashes();// tell all threads to do nothing for a specific timediff --git a/htroot/index.html b/htroot/index.htmlindex 72a5bfe07..b1f2446ab 100644--- a/htroot/index.html+++ b/htroot/index.html@@ -6,14 +6,14 @@#%env/templates/metas.template%#<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?query=#[former]#" /><link rel="search" type="application/opensearchdescription+xml" title="YaCy Search on '#[clientname]#'" href="opensearchdescription.xml" />- <link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />- <script type="text/javascript" src="/js/highslide/highslide.js"></script>+ <link rel="stylesheet" type="text/css" media="screen" href="env/highslide.css" />+ <script type="text/javascript" src="js/highslide/highslide.js"></script><script type="text/javascript">hs.outlineType = 'rounded-white';</script>- <script src="/yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>- <script src="/yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>- <link media="screen" type="text/css" href="/yacy/ui/css/autocomplete.css" rel="stylesheet" />+ <script src="yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>+ <script src="yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>+ <link media="screen" type="text/css" href="yacy/ui/css/autocomplete.css" rel="stylesheet" /><script type="text/javascript" src="js/html.js"></script>- <script type="text/javascript" src="/yacy/ui/js/jquery.autocomplete.yacy.js"></script>+ <script type="text/javascript" src="yacy/ui/js/jquery.autocomplete.yacy.js"></script><script type="text/javascript">$(document).ready(function() {$('#search').autocomplete('/suggest.json', {parse: opensearch, delay: 0, selectFirst: false, scroll: false, max: 30});@@ -63,7 +63,7 @@#(searchaudio)#::<input type="radio" id="audio" name="contentdom" value="audio" #(check)#::checked="checked"#(/check)# /><label for="audio">Audio</label> #(/searchaudio)##(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label> #(/searchvideo)##(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)#- #(searchoptions)# <a href="/index.html?searchoptions=1" onclick="this.href='/index.html?searchoptions=1&former='+document.getElementById('searchform').search.value+'&contentdom='+radioValue(document.getElementById('searchform').contentdom)">more options...</a>::#(/searchoptions)#+ #(searchoptions)# <a href="index.html?searchoptions=1" onclick="this.href='/index.html?searchoptions=1&former='+document.getElementById('searchform').search.value+'&contentdom='+radioValue(document.getElementById('searchform').contentdom)">more options...</a>::#(/searchoptions)#</div>#(/searchdomswitches)#<input type="hidden" name="nav" value="#[search.navigation]#" />@@ -145,11 +145,11 @@<dt>/http</dt><dd>only resources from http or https servers</dd><dt>/ftp</dt>- <dd>only resources from ftp servers (they are rare, <a href="/CrawlStartSite_p.html">crawl them yourself</a>)</dd>+ <dd>only resources from ftp servers (they are rare, <a href="CrawlStartSite_p.html">crawl them yourself</a>)</dd><dt>/smb</dt>- <dd>only resources from smb servers (<a href="/ConfigBasic.html">Intranet Indexing</a> must be selected)</dd>+ <dd>only resources from smb servers (<a href="ConfigBasic.html">Intranet Indexing</a> must be selected)</dd><dt>/file</dt>- <dd>only files from a local file system (<a href="/ConfigBasic.html">Intranet Indexing</a> must be selected)</dd>+ <dd>only files from a local file system (<a href="ConfigBasic.html">Intranet Indexing</a> must be selected)</dd></dl></dd><dt style="width:100px">ranking modifier</dt>@@ -165,6 +165,7 @@<dd>prefer given language (an ISO639 2-letter code)</dd></dl></dd>+ #(heuristic)#::<dt style="width:100px">heuristics</dt><dd><dl style="width:500px">@@ -172,6 +173,7 @@<dd>add search results from blekko</dd></dl></dd>+ #(/heuristic)#</dl><h4>Search Navigation</h4>diff --git a/htroot/index.java b/htroot/index.javaindex 07edfc37f..2f87043ee 100644--- a/htroot/index.java+++ b/htroot/index.java@@ -63,7 +63,11 @@ public class index {final boolean focus = (post == null) ? true : post.get("focus", "1").equals("1");int searchoptions = (post == null) ? 0 : Math.min(1, post.getInt("searchoptions", 0));- if (!sb.getConfigBool("search.options", true)) searchoptions = 0;+ if (!sb.getConfigBool("search.options", true)) {+ searchoptions = 0;+ } else { // show heuristic hint on search option screen+ prop.put("searchoptions_heuristic", sb.getConfigBool(SwitchboardConstants.HEURISTIC_OPENSEARCH, false));+ }final String former = (post == null) ? "" : post.get("former", "");final int count = Math.min(100, (post == null) ? 10 : post.getInt("count", 10));final int maximumRecords = sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10);diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 3c059907d..e4e3f4b0f 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -485,12 +485,6 @@ public class yacysearch {modifier.add("/heuristic/blekko");}- final int heuristicTwitter = querystring.indexOf("/heuristic/twitter", 0);- if ( heuristicTwitter >= 0 ) {- querystring = querystring.replace("/heuristic/twitter", "");- modifier.add("/heuristic/twitter");- }-final int tldp = querystring.indexOf("tld:", 0);if (tldp >= 0) {int ftb = querystring.indexOf(' ', tldp);@@ -524,7 +518,7 @@ public class yacysearch {}// the query- final QueryGoal qg = new QueryGoal(originalquerystring, querystring.trim());+ final QueryGoal qg = new QueryGoal(querystring.trim());final int maxDistance = (querystring.indexOf('"', 0) >= 0) ? qg.getIncludeHashes().size() - 1 : Integer.MAX_VALUE;// filter out stopwords@@ -688,7 +682,7 @@ public class yacysearch {ConcurrentLog.info("LOCAL_SEARCH","INIT WORD SEARCH: "- + theQuery.getQueryGoal().getOriginalQueryString(false)+ + theQuery.getQueryGoal().getQueryString(false)+ ":"+ QueryParams.hashSet2hashString(theQuery.getQueryGoal().getIncludeHashes())+ " - "@@ -697,7 +691,7 @@ public class yacysearch {+ theQuery.itemsPerPage()+ " lines to be displayed");EventChannel.channels(EventChannel.LOCALSEARCH).addMessage(- new RSSMessage("Local Search Request", theQuery.getQueryGoal().getOriginalQueryString(false), ""));+ new RSSMessage("Local Search Request", theQuery.getQueryGoal().getQueryString(false), ""));final long timestamp = System.currentTimeMillis();// create a new search event@@ -724,12 +718,9 @@ public class yacysearch {if ( modifier.sitehost != null && sb.getConfigBool(SwitchboardConstants.HEURISTIC_SITE, false) && authenticated && !stealthmode) {sb.heuristicSite(theSearch, modifier.sitehost);}- if ( (heuristicBlekko >= 0 || sb.getConfigBool(SwitchboardConstants.HEURISTIC_BLEKKO, false)) && authenticated && !stealthmode ) {+ if ( heuristicBlekko >= 0 && authenticated && !stealthmode ) {sb.heuristicRSS("http://blekko.com/ws/$+/rss", theSearch, "blekko");}- if ( (heuristicTwitter >= 0 || sb.getConfigBool(SwitchboardConstants.HEURISTIC_TWITTER, false)) && authenticated && !stealthmode ) {- sb.heuristicRSS("http://search.twitter.com/search.rss?rpp=50&q=$", theSearch, "twitter");- }if (sb.getConfigBool(SwitchboardConstants.HEURISTIC_OPENSEARCH, false) && authenticated && !stealthmode) {OpenSearchConnector.query(sb, theSearch);}@@ -737,7 +728,7 @@ public class yacysearch {// logConcurrentLog.info("LOCAL_SEARCH", "EXIT WORD SEARCH: "- + theQuery.getQueryGoal().getOriginalQueryString(false)+ + theQuery.getQueryGoal().getQueryString(false)+ " - "+ "local_rwi_available(" + theSearch.local_rwi_available.get() + "), "+ "local_rwi_stored(" + theSearch.local_rwi_stored.get() + "), "diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex 7ace4a33d..45e60f18b 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -129,7 +129,7 @@ public class yacysearchitem {faviconURL = null;}final String resource = theSearch.query.domType.toString();- final String origQ = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ final String origQ = theSearch.query.getQueryGoal().getQueryString(true);prop.put("content", 1); // switch on specific contentprop.put("content_showDate", sb.getConfigBool("search.result.show.date", true) ? 1 : 0);prop.put("content_showSize", sb.getConfigBool("search.result.show.size", true) ? 1 : 0);diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.javaindex 853949f65..984bfef57 100644--- a/htroot/yacysearchtrailer.java+++ b/htroot/yacysearchtrailer.java@@ -85,7 +85,7 @@ public class yacysearchtrailer {break;}nav = "inurl%3A" + name;- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {pos++;@@ -130,7 +130,7 @@ public class yacysearchtrailer {break;}nav = "site%3A" + name;- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {pos++;@@ -174,7 +174,7 @@ public class yacysearchtrailer {break;}nav = (name.indexOf(' ', 0) < 0) ? "author%3A" + name : "author%3A%28" + name.replace(" ", "+") + "%29";- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {pos++;@@ -211,7 +211,7 @@ public class yacysearchtrailer {prop.put("nav-topics", "1");navigatorIterator = topicNavigator.keys(false);int i = 0;- String queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ String queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);// first sort the list to a form where the greatest element is in the middleLinkedList<Map.Entry<String, Integer>> cloud = new LinkedList<Map.Entry<String, Integer>>();while (i < MAX_TOPWORDS && navigatorIterator.hasNext()) {@@ -257,7 +257,7 @@ public class yacysearchtrailer {}visible = visible || "ftp,smb".indexOf(name) >= 0;nav = "%2F" + name;- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {pos++;@@ -303,7 +303,7 @@ public class yacysearchtrailer {}visible = visible || Classification.isMediaExtension(name) || "pdf,doc,docx".indexOf(name) >= 0;nav = "filetype%3A" + name;- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {pos++;@@ -352,7 +352,7 @@ public class yacysearchtrailer {break;}nav = "%2Fvocabulary%2F" + navname + "%2F" + MultiProtocolURL.escape(Tagging.encodePrintname(name)).toString();- queryStringForUrl = theSearch.query.getQueryGoal().getOriginalQueryString(true);+ queryStringForUrl = theSearch.query.getQueryGoal().getQueryString(true);p = queryStringForUrl.indexOf(nav);if (p < 0) {queryStringForUrl += "+" + nav;@@ -397,9 +397,9 @@ public class yacysearchtrailer {prop.put("cat-location", 0);} else {prop.put("cat-location", 1);- final String query = theSearch.query.getQueryGoal().getOriginalQueryString(false);+ final String query = theSearch.query.getQueryGoal().getQueryString(false);prop.put(fileType, "cat-location_query", query);- final String queryenc = theSearch.query.getQueryGoal().getOriginalQueryString(true).replace(' ', '+');+ final String queryenc = theSearch.query.getQueryGoal().getQueryString(true).replace(' ', '+');prop.put(fileType, "cat-location_queryenc", queryenc);}prop.put("num-results_totalcount", theSearch.getResultCount());diff --git a/source/net/yacy/http/servlets/GSAsearchServlet.java b/source/net/yacy/http/servlets/GSAsearchServlet.javaindex 7ff36b99e..fd143939b 100644--- a/source/net/yacy/http/servlets/GSAsearchServlet.java+++ b/source/net/yacy/http/servlets/GSAsearchServlet.java@@ -128,7 +128,7 @@ public class GSAsearchServlet extends HttpServlet {post.put("originalQuery", originalQuery);// get a solr query string- QueryGoal qg = new QueryGoal(originalQuery, originalQuery);+ QueryGoal qg = new QueryGoal(originalQuery);StringBuilder solrQ = qg.collectionTextQueryString(sb.index.fulltext().getDefaultConfiguration(), 0, false);post.put("defType", "edismax");post.put(CommonParams.Q, solrQ.toString());diff --git a/source/net/yacy/http/servlets/SolrServlet.java b/source/net/yacy/http/servlets/SolrServlet.javaindex 929de73e6..f66d0f234 100644--- a/source/net/yacy/http/servlets/SolrServlet.java+++ b/source/net/yacy/http/servlets/SolrServlet.java@@ -135,7 +135,7 @@ public class SolrServlet extends HttpServlet {QueryModifier modifier = new QueryModifier();querystring = modifier.parse(querystring);modifier.apply(mmsp);- QueryGoal qg = new QueryGoal(querystring, querystring);+ QueryGoal qg = new QueryGoal(querystring);StringBuilder solrQ = qg.collectionTextQueryString(sb.index.fulltext().getDefaultConfiguration(), profileNr, false);mmsp.getMap().put(CommonParams.Q, new String[]{solrQ.toString()}); // sru patch}diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.javaindex 8e92c89fa..98c1129d0 100644--- a/source/net/yacy/peers/Protocol.java+++ b/source/net/yacy/peers/Protocol.java@@ -1010,7 +1010,7 @@ public final class Protocol {final int partitions,final Blacklist blacklist) {- if (event.query.getQueryGoal().getOriginalQueryString(false) == null || event.query.getQueryGoal().getOriginalQueryString(false).length() == 0) {+ if (event.query.getQueryGoal().getQueryString(false) == null || event.query.getQueryGoal().getQueryString(false).length() == 0) {return -1; // we cannot query solr only with word hashes, there is no clear text string}event.addExpectedRemoteReferences(count);diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.javaindex c997c3341..2af8c0235 100644--- a/source/net/yacy/search/Switchboard.java+++ b/source/net/yacy/search/Switchboard.java@@ -682,6 +682,16 @@ public final class Switchboard extends serverSwitch {this.log.info("surrogates.out Path = " + this.surrogatesOutPath.getAbsolutePath());this.surrogatesOutPath.mkdirs();+ // copy opensearch heuristic config (if not exist)+ final File osdConfig = new File(getDataPath(), "DATA/SETTINGS/heuristicopensearch.conf");+ if (!osdConfig.exists()) {+ final File osdDefaultConfig = new File("defaults/heuristicopensearch.conf");+ this.log.info("heuristic.opensearch list Path = " + osdDefaultConfig.getAbsolutePath());+ try {+ Files.copy(osdDefaultConfig, osdConfig);+ } catch (final IOException ex) { }+ }+// create the release download directorythis.releasePath =getDataPath(SwitchboardConstants.RELEASE_PATH, SwitchboardConstants.RELEASE_PATH_DEFAULT);@@ -1321,8 +1331,7 @@ public final class Switchboard extends serverSwitch {// remove heuristicssetConfig(SwitchboardConstants.HEURISTIC_SITE, false);- setConfig(SwitchboardConstants.HEURISTIC_BLEKKO, false);- setConfig(SwitchboardConstants.HEURISTIC_TWITTER, false);+ setConfig(SwitchboardConstants.HEURISTIC_OPENSEARCH, false);// relocatethis.peers.relocate(@@ -3582,7 +3591,7 @@ public final class Switchboard extends serverSwitch {new Thread() {@Overridepublic void run() {- String queryString = searchEvent.query.getQueryGoal().getOriginalQueryString(false);+ String queryString = searchEvent.query.getQueryGoal().getQueryString(false);Thread.currentThread().setName("Switchboard.heuristicRSS:" + queryString);final int meta = queryString.indexOf("heuristic:", 0);if ( meta >= 0 ) {diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.javaindex 2a23254b0..5f0704d3e 100644--- a/source/net/yacy/search/SwitchboardConstants.java+++ b/source/net/yacy/search/SwitchboardConstants.java@@ -522,8 +522,6 @@ public final class SwitchboardConstants {public static final String HEURISTIC_SITE = "heuristic.site";public static final String HEURISTIC_SEARCHRESULTS = "heuristic.searchresults";public static final String HEURISTIC_SEARCHRESULTS_CRAWLGLOBAL = "heuristic.searchresults.crawlglobal";- public static final String HEURISTIC_BLEKKO = "heuristic.blekko";- public static final String HEURISTIC_TWITTER = "heuristic.twitter";public static final String HEURISTIC_OPENSEARCH = "heuristic.opensearch";/*diff --git a/source/net/yacy/search/query/AccessTracker.java b/source/net/yacy/search/query/AccessTracker.javaindex 014fe3f6e..fabea0b6f 100644--- a/source/net/yacy/search/query/AccessTracker.java+++ b/source/net/yacy/search/query/AccessTracker.java@@ -96,7 +96,7 @@ public class AccessTracker {private static void add(final LinkedList<QueryParams> list, final QueryParams query, int resultCount) {// learn that this word can be a word completion for the DidYouMeanLibrary- String queryString = query.getQueryGoal().getOriginalQueryString(false);+ String queryString = query.getQueryGoal().getQueryString(false);if (resultCount > 10 && queryString != null && queryString.length() > 0) {final StringBuilder sb = new StringBuilder(queryString);sb.append(queryString);@@ -138,7 +138,7 @@ public class AccessTracker {}private static void addToDump(final QueryParams query, int resultCount) {- String queryString = query.getQueryGoal().getOriginalQueryString(false);+ String queryString = query.getQueryGoal().getQueryString(false);if (queryString == null || queryString.isEmpty()) return;addToDump(queryString, Integer.toString(resultCount), new Date(query.starttime));}diff --git a/source/net/yacy/search/query/QueryGoal.java b/source/net/yacy/search/query/QueryGoal.javaindex 5ae21723e..0b0e5acaa 100644--- a/source/net/yacy/search/query/QueryGoal.java+++ b/source/net/yacy/search/query/QueryGoal.java@@ -97,11 +97,14 @@ public class QueryGoal {this.include_hashes = include_hashes;this.exclude_hashes = exclude_hashes;}-- public QueryGoal(String query_original, String query_words) {- assert query_original != null;++ /**+ * Creates a QueryGoal from a serach query string+ * @param query_words search string (the actual search terms, excluding application specific modifier)+ */+ public QueryGoal(String query_words) {assert query_words != null;- this.query_original = query_original;+ this.query_original = query_words;this.include_words = new NormalizedWords();this.exclude_words = new NormalizedWords();this.include_strings = new ArrayList<String>();@@ -175,7 +178,14 @@ public class QueryGoal {}}- public String getOriginalQueryString(final boolean encodeHTML) {+ /**+ * Search query string (without YaCy specific modifier like site:xxx or /smb)+ * the modifier are held separately in a search paramter modifier+ *+ * @param encodeHTML+ * @return+ */+ public String getQueryString(final boolean encodeHTML) {if (this.query_original == null) return null;String ret;if (encodeHTML){@@ -189,7 +199,7 @@ public class QueryGoal {}return ret;}-+/*** @return a set of hashes of words to be included in the search result.* if possible, use getIncludeWords insteaddiff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.javaindex cc2b87966..0787e6b44 100644--- a/source/net/yacy/search/query/QueryParams.java+++ b/source/net/yacy/search/query/QueryParams.java@@ -602,7 +602,7 @@ public final class QueryParams {sb.append("/yacysearch.");sb.append(ext);sb.append("?query=");- sb.append(newQueryString == null ? theQuery.getQueryGoal().getOriginalQueryString(true) : newQueryString);+ sb.append(newQueryString == null ? theQuery.getQueryGoal().getQueryString(true) : newQueryString);sb.append("&maximumRecords=");sb.append(theQuery.itemsPerPage());@@ -625,7 +625,7 @@ public final class QueryParams {sb.append(theQuery.contentdom.toString());sb.append("&former=");- sb.append(theQuery.getQueryGoal().getOriginalQueryString(true));+ sb.append(theQuery.getQueryGoal().getQueryString(true));return sb;}diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.javaindex db5c69e52..a84a18c6e 100644--- a/source/net/yacy/search/query/SearchEvent.java+++ b/source/net/yacy/search/query/SearchEvent.java@@ -454,7 +454,7 @@ public final class SearchEvent {new ProfilingGraph.EventSearch(SearchEvent.this.query.id(true),SearchEventType.JOIN,- SearchEvent.this.query.getQueryGoal().getOriginalQueryString(false),+ SearchEvent.this.query.getQueryGoal().getQueryString(false),index.size(),System.currentTimeMillis() - timer),false);