diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.js index 270f387f8..0e71bacf3 100644 --- a/htroot/js/yacysearch.js +++ b/htroot/js/yacysearch.js @@ -80,46 +80,45 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS document.getElementById("remoteResourceSize").firstChild.nodeValue = remoteResourceSize; document.getElementById("remoteIndexCount").firstChild.nodeValue = remoteIndexCount; document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount; - - var resNav = document.getElementById("resNav"); - resNav.firstChild.nodeValue = "X"; + document.getElementById("resNav").firstChild.nodeValue = "X"; // compose page navigation resnav = ""; - thispage = offset / itemsperpage; - if (thispage == 0) { - resnav += ("\"arrowleft\" "); - } else { - resnav += ("\"arrowleft\" "); - } - numberofpages = Math.min(10, 1 + (((localResourceSize + remoteResourceSize) - 1) / itemsperpage)); - - for (i = 0; i < numberofpages; i++) { - if (i == thispage) { - resnav += "\"page"); "); - } else { - resnav += ("\"page"); "); - } - } - if (thispage >= numberofpages) { - resnav += ("\"arrowright\""); - } else { - resnav += ("\"arrowright\""); - } + thispage = Math.floor(offset / itemsperpage); + if (thispage == 0) { + resnav += ("\"arrowleft\" "); + } else { + resnav += ("\"arrowleft\" "); + } - //document.getElementById("resNav").firstChild.nodeValue = resnav; + numberofpages = Math.min(10, 1 + ((totalcount - 1) / itemsperpage)); + if (!numberofpages) numberofpages = 10; + for (i = 0; i < numberofpages; i++) { + if (i == thispage) { + resnav += "\"page"); "); + } else { + resnav += ("\"page"); "); + } + } + if (thispage >= numberofpages) { + resnav += ("\"arrowright\""); + } else { + resnav += ("\"arrowright\""); + } + + document.getElementById("resNav").innerHTML = resnav; } diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 308a39d20..3a76dcbb0 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -234,7 +234,7 @@ function latestinfo() { self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { var rsp = eval("(" + self.xmlHttpReq.responseText + ")"); - statistics(rsp.offset, rsp.itemscount, rsp.itemsperpage, rsp.totalcount, rsp.localResourceSize, rsp.remoteResourceSize, rsp.remoteIndexCount, rsp.remotePeerCount); + statistics(rsp.offset, rsp.itemscount, rsp.itemsperpage, rsp.totalcount, rsp.localResourceSize, rsp.remoteResourceSize, rsp.remoteIndexCount, rsp.remotePeerCount, rsp.navurlBase); } } self.xmlHttpReq.send(null); diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index f6a5b82d2..d5a78374c 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -740,8 +740,8 @@ public class yacysearch { } final int indexcount = theSearch.getRankingResult().getLocalIndexCount() - theSearch.getRankingResult().getMissCount() - theSearch.getRankingResult().getSortOutCount() + theSearch.getRankingResult().getRemoteIndexCount(); - prop.put("num-results_offset", offset); - prop.put("num-results_itemscount", Formatter.number(0, true)); + prop.put("num-results_offset", offset + 1); + prop.put("num-results_itemscount", Formatter.number(offset + theSearch.getQuery().itemsPerPage > indexcount ? offset + indexcount % theSearch.getQuery().itemsPerPage : offset + theSearch.getQuery().itemsPerPage, true)); prop.put("num-results_itemsPerPage", itemsPerPage); prop.put("num-results_totalcount", Formatter.number(indexcount, true)); prop.put("num-results_globalresults", global && (indexReceiveGranted || clustersearch) ? "1" : "0"); diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html index 87ed0b642..0b2ae0783 100644 --- a/htroot/yacysearchitem.html +++ b/htroot/yacysearchitem.html @@ -56,7 +56,7 @@ #(/content)# diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index c0608772f..dde0c94c5 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -101,6 +101,7 @@ public class yacysearchitem { prop.put("remoteResourceSize", Formatter.number(theSearch.getRankingResult().getRemoteResourceSize(), true)); prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true)); prop.put("remotePeerCount", Formatter.number(theSearch.getRankingResult().getRemotePeerCount(), true)); + prop.put("navurlBase", QueryParams.navurlBase("html", theQuery, null, theQuery.urlMask.toString(), theQuery.navigators).toString()); final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET, "_self"); if (theQuery.contentdom == ContentDomain.TEXT) { diff --git a/htroot/yacysearchlatestinfo.java b/htroot/yacysearchlatestinfo.java index f4e818516..031f91892 100644 --- a/htroot/yacysearchlatestinfo.java +++ b/htroot/yacysearchlatestinfo.java @@ -20,7 +20,7 @@ public class yacysearchlatestinfo { // the event does not exist. // to avoid missing patterns, we return dummy values prop.put("offset", 0); - prop.put("itemscount", -1); + prop.put("itemscount", 0); prop.put("itemsperpage", 10); prop.put("totalcount", 0); prop.put("localResourceSize", 0); @@ -36,7 +36,7 @@ public class yacysearchlatestinfo { final int totalcount = theSearch.getRankingResult().getLocalIndexCount() - theSearch.getRankingResult().getMissCount() - theSearch.getRankingResult().getSortOutCount() + theSearch.getRankingResult().getRemoteIndexCount(); final int offset = theQuery.neededResults() - theQuery.displayResults() + 1; prop.put("offset", offset); - prop.put("itemscount", -1); + prop.put("itemscount",Formatter.number(offset + theSearch.getQuery().itemsPerPage >= totalcount ? offset + totalcount % theSearch.getQuery().itemsPerPage - 1 : offset + theSearch.getQuery().itemsPerPage - 1)); prop.put("itemsperpage", theSearch.getQuery().itemsPerPage); prop.put("totalcount", Formatter.number(totalcount, true)); prop.put("localResourceSize", Formatter.number(theSearch.getRankingResult().getLocalIndexCount(), true)); @@ -44,6 +44,7 @@ public class yacysearchlatestinfo { prop.put("remoteResourceSize", Formatter.number(theSearch.getRankingResult().getRemoteResourceSize(), true)); prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true)); prop.put("remotePeerCount", Formatter.number(theSearch.getRankingResult().getRemotePeerCount(), true)); + prop.putJSON("navurlBase", QueryParams.navurlBase("html", theQuery, null, theQuery.urlMask.toString(), theQuery.navigators).toString()); return prop; } diff --git a/htroot/yacysearchlatestinfo.json b/htroot/yacysearchlatestinfo.json index b58401deb..6e00012ee 100644 --- a/htroot/yacysearchlatestinfo.json +++ b/htroot/yacysearchlatestinfo.json @@ -1,4 +1,5 @@ { +"offset": "#[offset]#", "itemscount": "#[itemscount]#", "itemsperpage": "#[itemsperpage]#", "totalcount": "#[totalcount]#", @@ -6,5 +7,6 @@ "localMissCount": "#[localMissCount]#", "remoteResourceSize": "#[remoteResourceSize]#", "remoteIndexCount": "#[remoteIndexCount]#", -"remotePeerCount": "#[remotePeerCount]#" +"remotePeerCount": "#[remotePeerCount]#", +"navurlBase": "#[navurlBase]#" } diff --git a/readme.txt b/readme.txt index 5798cb43a..2ca3c0385 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,4 @@ -WHAT IS THIS? - +== WHAT IS THIS? == YaCy is a search engine software. It takes a new approach to search because it does not use a central server. Instead, its search results come from a network of independent peers. In such a distributed network, @@ -35,13 +34,12 @@ set up their own node. More users are leading to higher index capacity and better distributed indexing performance. -LICENSE +== LICENSE == YaCy is published under the GPL v2 The source code is inside the release package (see /source and /htroot). -WHERE IS THE DOCUMENTATION? - +== WHERE IS THE DOCUMENTATION? == Documentation can be found at: (Home Page) http://yacy.net/ (German Forum) http://forum.yacy.de/ @@ -52,8 +50,7 @@ Every of these locations has a (YaCy) search functionality which combines all these locations into one search result. -DEPENDENCIES? WHAT OTHER SOFTWARE DO I NEED? - +== DEPENDENCIES? WHAT OTHER SOFTWARE DO I NEED? == You need java 1.6 or later to run YaCy, nothing else. Please download it from http://www.java.com @@ -64,8 +61,7 @@ NO OTHER SOFTWARE IS REQUIRED! (you don't need apache, tomcat or mysql or whatever) -HOW DO I START THIS SOFTWARE? - +== HOW DO I START THIS SOFTWARE? == Startup and Shutdown of YaCy: - on Linux: @@ -81,8 +77,7 @@ please use the Mac Application and start or stop it like any other Mac Application (doubleclick to start) -HOW DO I USE THIS SOFTWARE, WHERE IS THE ADMINISTRATION INTERFACE? - +== HOW DO I USE THIS SOFTWARE, WHERE IS THE ADMINISTRATION INTERFACE? == YaCy is a build on a web server. After you started YaCy, start your browser and open @@ -91,8 +86,7 @@ start your browser and open There you can see your personal search and administration interface. -WHAT IF I INSTALL YACY (HEADLESS) ON A SERVER - +== WHAT IF I INSTALL YACY (HEADLESS) ON A SERVER == You can do that but YaCy authorizes users automatically if they access the server from the localhost. After about 10 minutes a random password is generated and then it is not possible to log in from @@ -105,15 +99,29 @@ http://:8090/ConfigAccounts_p.html and set an administration account. -DEVELOPER: +== HOW CAN I SCALE THIS; HOW MUCH RAM IS NEEDED; DISK SPACE? == +YaCy can scale up to many millions of web pages in your own search index. +The default assignment of RAM is 600MB which is assigned to the java +process but not permanently used by it. The GC process will free the memory +once in a while. If you have a small index (i.e. about 100000 pages) +then you may assign _less_ memory (i.e. 200MB) but if your index scales +up to over 1 million web pages then you should start to increase the +memory assignment. Open http://localhost:8090/Performance_p.html +and set a higher/lower memory assignment. +If you have millions of web pages in your search index then you might +habe gigabytes of disk space allocated. You can reduce the disk +space i.e. setting the htcache space to a different size; to do that +open http://localhost:8090/ConfigHTCache_p.html and set a new size. + + +== JOIN THE DEVELOPMENT! == YaCy was created with the help of many. About 30 programmers have helped, a list of some of them can be seen here: http://yacy.net/en/Join.html Please join us! -HOW TO GET THE SOURCE CODE AND HOW TO COMPILE YACY YOURSELF? - +== HOW TO GET THE SOURCE CODE AND HOW TO COMPILE YACY YOURSELF? == The source code is inside every YaCy release. You can also get YaCy from https://gitorious.org/yacy/rc1 Please clone our code and help with development! @@ -130,8 +138,7 @@ Compiling YaCy: after the dist prodecure, the release can be found in the RELEASE subdirectory -ARE THERE ANY APIs OR HOW CAN I ATTACH SOFTWARE AT YACY? - +== ARE THERE ANY APIs OR HOW CAN I ATTACH SOFTWARE AT YACY? == There are many interfaces build-in in YaCy and they are all based on http/xml and http/json. You can discover these interfaces if you notice the orange "API" icon in the upper right of some web pages in the YaCy web interface. Just click on it and @@ -142,8 +149,7 @@ subdirectory. The just call also the web interface pages. By cloning some of tho scripts you can create more shell api access methods yourself easily. -CONTACT: - +== CONTACT == Our primary point of contact is the german forum at http://forum.yacy.net There is also an english forum at http://www.yacy-forum.org We encourage you to start a YaCy forum in your own language.