Merge branch 'master' of git://github.com/f1ori/yacy

This commit is contained in:
admin 2011-11-27 17:01:29 +01:00
commit dfb6c0bca5
8 changed files with 74 additions and 65 deletions

View File

@ -80,13 +80,11 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
document.getElementById("remoteResourceSize").firstChild.nodeValue = remoteResourceSize; document.getElementById("remoteResourceSize").firstChild.nodeValue = remoteResourceSize;
document.getElementById("remoteIndexCount").firstChild.nodeValue = remoteIndexCount; document.getElementById("remoteIndexCount").firstChild.nodeValue = remoteIndexCount;
document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount; document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount;
document.getElementById("resNav").firstChild.nodeValue = "X";
var resNav = document.getElementById("resNav");
resNav.firstChild.nodeValue = "X";
// compose page navigation // compose page navigation
resnav = ""; resnav = "";
thispage = offset / itemsperpage; thispage = Math.floor(offset / itemsperpage);
if (thispage == 0) { if (thispage == 0) {
resnav += ("<img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" />&nbsp;"); resnav += ("<img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" />&nbsp;");
} else { } else {
@ -94,8 +92,9 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
resnav += (navurlbase + "&amp;startRecord=" + ((thispage - 1) * itemsperpage)); resnav += (navurlbase + "&amp;startRecord=" + ((thispage - 1) * itemsperpage));
resnav += ("\"><img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" /></a>&nbsp;"); resnav += ("\"><img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" /></a>&nbsp;");
} }
numberofpages = Math.min(10, 1 + (((localResourceSize + remoteResourceSize) - 1) / itemsperpage));
numberofpages = Math.min(10, 1 + ((totalcount - 1) / itemsperpage));
if (!numberofpages) numberofpages = 10;
for (i = 0; i < numberofpages; i++) { for (i = 0; i < numberofpages; i++) {
if (i == thispage) { if (i == thispage) {
resnav += "<img src=\"env/grafics/navs"; resnav += "<img src=\"env/grafics/navs";
@ -121,5 +120,5 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
resnav += ("\"><img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" /></a>"); resnav += ("\"><img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" /></a>");
} }
//document.getElementById("resNav").firstChild.nodeValue = resnav; document.getElementById("resNav").innerHTML = resnav;
} }

View File

@ -234,7 +234,7 @@ function latestinfo() {
self.xmlHttpReq.onreadystatechange = function() { self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) { if (self.xmlHttpReq.readyState == 4) {
var rsp = eval("(" + self.xmlHttpReq.responseText + ")"); 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); self.xmlHttpReq.send(null);

View File

@ -740,8 +740,8 @@ public class yacysearch {
} }
final int indexcount = theSearch.getRankingResult().getLocalIndexCount() - theSearch.getRankingResult().getMissCount() - theSearch.getRankingResult().getSortOutCount() + theSearch.getRankingResult().getRemoteIndexCount(); 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_offset", offset + 1);
prop.put("num-results_itemscount", Formatter.number(0, true)); 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_itemsPerPage", itemsPerPage);
prop.put("num-results_totalcount", Formatter.number(indexcount, true)); prop.put("num-results_totalcount", Formatter.number(indexcount, true));
prop.put("num-results_globalresults", global && (indexReceiveGranted || clustersearch) ? "1" : "0"); prop.put("num-results_globalresults", global && (indexReceiveGranted || clustersearch) ? "1" : "0");

View File

@ -56,7 +56,7 @@
#(/content)# #(/content)#
<script type="text/javascript"> <script type="text/javascript">
statistics("#[offset]#", "#[itemscount]#", "#[itemsperpage]#", "#[totalcount]#", "#[localResourceSize]#", "#[remoteResourceSize]#", "#[remoteIndexCount]#", "#[remotePeerCount]#"); statistics("#[offset]#", "#[itemscount]#", "#[itemsperpage]#", "#[totalcount]#", "#[localResourceSize]#", "#[remoteResourceSize]#", "#[remoteIndexCount]#", "#[remotePeerCount]#", #[navurlBase]#);
progressbar.step(1); progressbar.step(1);
</script> </script>

View File

@ -101,6 +101,7 @@ public class yacysearchitem {
prop.put("remoteResourceSize", Formatter.number(theSearch.getRankingResult().getRemoteResourceSize(), true)); prop.put("remoteResourceSize", Formatter.number(theSearch.getRankingResult().getRemoteResourceSize(), true));
prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true)); prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true));
prop.put("remotePeerCount", Formatter.number(theSearch.getRankingResult().getRemotePeerCount(), 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"); final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET, "_self");
if (theQuery.contentdom == ContentDomain.TEXT) { if (theQuery.contentdom == ContentDomain.TEXT) {

View File

@ -20,7 +20,7 @@ public class yacysearchlatestinfo {
// the event does not exist. // the event does not exist.
// to avoid missing patterns, we return dummy values // to avoid missing patterns, we return dummy values
prop.put("offset", 0); prop.put("offset", 0);
prop.put("itemscount", -1); prop.put("itemscount", 0);
prop.put("itemsperpage", 10); prop.put("itemsperpage", 10);
prop.put("totalcount", 0); prop.put("totalcount", 0);
prop.put("localResourceSize", 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 totalcount = theSearch.getRankingResult().getLocalIndexCount() - theSearch.getRankingResult().getMissCount() - theSearch.getRankingResult().getSortOutCount() + theSearch.getRankingResult().getRemoteIndexCount();
final int offset = theQuery.neededResults() - theQuery.displayResults() + 1; final int offset = theQuery.neededResults() - theQuery.displayResults() + 1;
prop.put("offset", offset); 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("itemsperpage", theSearch.getQuery().itemsPerPage);
prop.put("totalcount", Formatter.number(totalcount, true)); prop.put("totalcount", Formatter.number(totalcount, true));
prop.put("localResourceSize", Formatter.number(theSearch.getRankingResult().getLocalIndexCount(), 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("remoteResourceSize", Formatter.number(theSearch.getRankingResult().getRemoteResourceSize(), true));
prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true)); prop.put("remoteIndexCount", Formatter.number(theSearch.getRankingResult().getRemoteIndexCount(), true));
prop.put("remotePeerCount", Formatter.number(theSearch.getRankingResult().getRemotePeerCount(), 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; return prop;
} }

View File

@ -1,4 +1,5 @@
{ {
"offset": "#[offset]#",
"itemscount": "#[itemscount]#", "itemscount": "#[itemscount]#",
"itemsperpage": "#[itemsperpage]#", "itemsperpage": "#[itemsperpage]#",
"totalcount": "#[totalcount]#", "totalcount": "#[totalcount]#",
@ -6,5 +7,6 @@
"localMissCount": "#[localMissCount]#", "localMissCount": "#[localMissCount]#",
"remoteResourceSize": "#[remoteResourceSize]#", "remoteResourceSize": "#[remoteResourceSize]#",
"remoteIndexCount": "#[remoteIndexCount]#", "remoteIndexCount": "#[remoteIndexCount]#",
"remotePeerCount": "#[remotePeerCount]#" "remotePeerCount": "#[remotePeerCount]#",
"navurlBase": "#[navurlBase]#"
} }

View File

@ -1,5 +1,4 @@
WHAT IS THIS? == WHAT IS THIS? ==
YaCy is a search engine software. It takes a new approach to search 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 because it does not use a central server. Instead, its search results
come from a network of independent peers. In such a distributed network, 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. and better distributed indexing performance.
LICENSE == LICENSE ==
YaCy is published under the GPL v2 YaCy is published under the GPL v2
The source code is inside the release package (see /source and /htroot). 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: Documentation can be found at:
(Home Page) http://yacy.net/ (Home Page) http://yacy.net/
(German Forum) http://forum.yacy.de/ (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. 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. You need java 1.6 or later to run YaCy, nothing else.
Please download it from http://www.java.com 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) (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: Startup and Shutdown of YaCy:
- on Linux: - on Linux:
@ -81,8 +77,7 @@ please use the Mac Application and start or stop it like any
other Mac Application (doubleclick to start) 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, YaCy is a build on a web server. After you started YaCy,
start your browser and open start your browser and open
@ -91,8 +86,7 @@ start your browser and open
There you can see your personal search and administration interface. 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 You can do that but YaCy authorizes users automatically if they
access the server from the localhost. After about 10 minutes a random 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 password is generated and then it is not possible to log in from
@ -105,15 +99,29 @@ http://<remote-server-address>:8090/ConfigAccounts_p.html
and set an administration account. 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, 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 a list of some of them can be seen here: http://yacy.net/en/Join.html
Please join us! 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 The source code is inside every YaCy release. You can also get YaCy
from https://gitorious.org/yacy/rc1 from https://gitorious.org/yacy/rc1
Please clone our code and help with development! 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 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 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 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 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. 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 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 There is also an english forum at http://www.yacy-forum.org
We encourage you to start a YaCy forum in your own language. We encourage you to start a YaCy forum in your own language.