Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
better navigation in file search: less results by first try, but much faster. after the first search is done, buttons appear to get more results for the same search
Michael Peter Christenfa7b3481b341
diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.jsindex 21d2d21f1..f7d979175 100644--- a/htroot/js/yacyinteractive.js+++ b/htroot/js/yacyinteractive.js@@ -23,7 +23,7 @@ function search(search, count, offset) {if (navhtml != null) navhtml.innerHTML = "<div>loading from local index...</div>";query = search;maximumRecords = count;- if (count == "") maximumRecords = 1000;+ if (count == "") maximumRecords = 100;startRecord = offset;if (offset == "") startRecord = 0;start = new Date();@@ -100,16 +100,23 @@ function resultNavigation() {if (searchresult.length > totalResults) totalResults = searchresult.length;if (totalResults > 0) {html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index; search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds. ";- html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>";+ html += "<div style=\"clear:left\">";+ html += "<div style=\"display:inline\" id=\"downloadbutton\"></div>";+ if (maximumRecords != 10 && totalResults >= 10) html += "<input type=\"button\" value=\"10 results\" onClick=\"window.location.href='/yacyinteractive.html?query=" + query + "&startRecord=" + startRecord + "&maximumRecords=10'\"/>";+ if (maximumRecords != 100 && totalResults >= 100) html += "<input type=\"button\" value=\"100 results\" onClick=\"window.location.href='/yacyinteractive.html?query=" + query + "&startRecord=" + startRecord + "&maximumRecords=100'\"/>";+ if (maximumRecords != 1000 && totalResults >= 1000) html += "<input type=\"button\" value=\"1000 results\" onClick=\"window.location.href='/yacyinteractive.html?query=" + query + "&startRecord=" + startRecord + "&maximumRecords=1000'\"/>";+ if (totalResults <= 10000 && maximumRecords < totalResults) html += "<input type=\"button\" value=\"all results\" onClick=\"window.location.href='/yacyinteractive.html?query=" + query + "&startRecord=" + startRecord + "&maximumRecords=" + totalResults + "'\"/>";+ html += "</div>"; // for inline+ html += "</div>"; // for result statistic wrapper} else {if (query == "") {html += "please enter some search words<br\>or use the following predefined search queries:<br\>";html += "find images: ";- html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=png+filetype:png\">png</a>),";- html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=gif+filetype:gif\">gif</a>),";- html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=jpg+filetype:jpg\">jpg</a>)<br>";+ html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=png+filetype:png&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">png</a>),";+ html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=gif+filetype:gif&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">gif</a>),";+ html += "(<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=jpg+filetype:jpg&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">jpg</a>)<br>";html += "list: ";- html += "<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=pdf+/date+filetype:pdf\">recent pdf</a><br>";+ html += "<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=pdf+/date+filetype:pdf&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">recent pdf</a><br>";//html += "<iframe src=\"rssTerminal.html?set=LOCALINDEXING&width=600px&height=180px&maxlines=20&maxwidth=120\" ";//html += "style=\"width:600px;height:180px;margin:0px;\" scrolling=\"no\" name=\"newsframe\"></iframe>";} else {@@ -121,7 +128,7 @@ function resultNavigation() {var extnav = "";for (var key in filetypes) {if (filetypes[key] > 0) {- extnav += "<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=" + query + "+filetype:" + key + "\">" + key + "</a>(" + filetypes[key] + ") ";+ extnav += "<a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=" + query + "+filetype:" + key + "&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">" + key + "</a>(" + filetypes[key] + ") ";}}if (extnav.length > 0) {@@ -129,7 +136,7 @@ function resultNavigation() {} else {// check if there is a filetype constraint and offer a removalif (modifier != "") {- html += "<span style=\"display:block\"><a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=" + query.substring(0, query.length - 12) + "\">remove the filter '" + modifier + "'</a></span>";+ html += "<span style=\"display:block\"><a style=\"text-decoration:underline\" href=\"/yacyinteractive.html?query=" + query.substring(0, query.length - 12) + "&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">remove the filter '" + modifier + "'</a></span>";}}@@ -138,7 +145,7 @@ function resultNavigation() {if (topics && topics.length > 0) {var topwords = "";for (var i = 0; i < topics.elements.length; i++) {- topwords += "<a href=\"/yacyinteractive.html?query=" + query + "+" + topics.elements[i].name + "\">" + topics.elements[i].name + "</a> ";+ topwords += "<a href=\"/yacyinteractive.html?query=" + query + "+" + topics.elements[i].name + "&startRecord=" + startRecord + "&maximumRecords=" + maximumRecords + "\">" + topics.elements[i].name + "</a> ";if (i > 10) break;}html += " topwords: " + topwords;diff --git a/htroot/yacyinteractive.java b/htroot/yacyinteractive.javaindex cfc152bf5..d4a103deb 100644--- a/htroot/yacyinteractive.java+++ b/htroot/yacyinteractive.java@@ -48,10 +48,10 @@ public class yacyinteractive {final String query = (post == null) ? "" : post.get("query", "");final String startRecord = (post == null) ? "0" : post.get("startRecord", "");- final String maximumRecords = (post == null) ? "1000" : post.get("maximumRecords", "");+ final String maximumRecords = (post == null) ? "10" : post.get("maximumRecords", "");prop.putHTML("query", query);- prop.putHTML("startRecord", startRecord);- prop.putHTML("maximumRecords", maximumRecords);+ prop.put("startRecord", startRecord);+ prop.put("maximumRecords", maximumRecords);prop.putHTML("querys", query.replaceAll(" ", "+"));prop.put("serverlist", query.length() == 0 ? 1 : 0);prop.put("allowrealtime", sb.indexSegments.URLCount() < 100000 ? 1 : 0);