Skip to content

Commit

Permalink
- added host, path, filename to search result
Browse files Browse the repository at this point in the history
- modified yacyinteractive, shows now also date
- added size attribut to export file in xml format

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5639 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Feb 23, 2009
1 parent 7cfab2e commit de71478
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions htroot/yacyinteractive.html
Expand Up @@ -53,16 +53,16 @@
var item;
html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";
html += "<tr class=\"TableHeader\" valign=\"bottom\">";
html += "<td width=\"30%\">Name</td>";
html += "<td>Name</td>";
html += "<td width=\"60\">Size</td>";
//html += "<td>Description</td>";
html += "<td>Link</td></tr>";
html += "<td width=\"180\">Date</td></tr>";
for (var i = 0; i < firstChannel.items.length; i++) {
item = firstChannel.items[i];
html += "<tr class=\"TableCellLight\"><td>"+ item.title + "</td>";
html += "<tr class=\"TableCellLight\"><td align=\"left\"><a href=\"" + item.link + "\">" + item.title + "</a></td>";
html += "<td align=\"right\">" + item.sizename + "</td>";
//html += "<td>" + item.description + "</td>";
html += "<td><a href=\"" + item.link + "\">" + item.link + "</a></td></tr>";
html += "<td align=\"right\">" + item.pubDate + "</td></tr>";
}
html += "</table>";
}
Expand Down
5 changes: 4 additions & 1 deletion htroot/yacysearchitem.java
Expand Up @@ -124,8 +124,11 @@ public static serverObjects respond(final httpRequestHeader header, final server
prop.put("content_date", plasmaSwitchboard.dateString(result.modified()));
prop.put("content_date822", plasmaSwitchboard.dateString822(result.modified()));
prop.put("content_ybr", plasmaSearchRankingProcess.ybr(result.hash()));
prop.putNum("content_size", result.filesize());
prop.putHTML("content_size", Integer.toString(result.filesize())); // we don't use putNUM here because that number shall be usable as sorting key. To print the size, use 'sizename'
prop.putHTML("content_sizename", sizename(result.filesize()));
prop.putHTML("content_host", result.url().getHost());
prop.putHTML("content_file", result.url().getFile());
prop.putHTML("content_path", result.url().getPath());
prop.put("content_nl", (item == 0) ? 0 : 1);

final TreeSet<String>[] query = theQuery.queryWords();
Expand Down
5 changes: 4 additions & 1 deletion htroot/yacysearchitem.json
Expand Up @@ -6,5 +6,8 @@
"pubDate": "#[date822]#",
"size": "#[size]#",
"sizename": "#[sizename]#",
"guid": "#[urlhash]#"
"guid": "#[urlhash]#",
"host": "#[host]#",
"path": "#[path]#",
"file": "#[file]#"
}#(/content)#
3 changes: 3 additions & 0 deletions htroot/yacysearchitem.xml
Expand Up @@ -5,5 +5,8 @@
<pubDate>#[date822]#</pubDate>
<yacy:size>#[size]#</yacy:size>
<yacy:sizename>#[sizename]#</yacy:sizename>
<yacy:host>#[host]#</yacy:host>
<yacy:path>#[path]#</yacy:path>
<yacy:file>#[file]#</yacy:file>
<guid isPermaLink="false">#[urlhash]#</guid>
</item>#(/content)#
3 changes: 2 additions & 1 deletion source/de/anomic/index/indexRepositoryReference.java
Expand Up @@ -423,7 +423,7 @@ public void run() {
if (format == 2) {
pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
pw.println("<?xml-stylesheet type='text/xsl' href='/yacysearch.xsl' version='1.0'?>");
pw.println("<rss version=\"2.0\">");
pw.println("<rss version=\"2.0\" xmlns:yacy=\"http://www.yacy.net/\" xmlns:opensearch=\"http://a9.com/-/spec/opensearch/1.1/\" xmlns:atom=\"http://www.w3.org/2005/Atom\">");
pw.println("<channel>");
pw.println("<title>YaCy Peer-to-Peer - Web-Search LURL Export</title>");
pw.println("<description></description>");
Expand Down Expand Up @@ -461,6 +461,7 @@ public void run() {
if (comp.dc_creator().length() > 0) pw.println("<author>" + htmlFilterCharacterCoding.unicode2xml(comp.dc_creator(), true) + "</author>");
if (comp.dc_subject().length() > 0) pw.println("<description>" + htmlFilterCharacterCoding.unicode2xml(comp.dc_subject(), true) + "</description>");
pw.println("<pubDate>" + entry.moddate().toString() + "</pubDate>");
pw.println("<yacy:size>" + entry.size() + "</yacy:size>");
pw.println("<guid isPermaLink=\"false\">" + entry.hash() + "</guid>");
pw.println("</item>");
}
Expand Down

0 comments on commit de71478

Please sign in to comment.