Skip to content

Commit

Permalink
fixed some json encoding problems in yacysearchitem
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5888 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
apfelmaennchen committed Apr 26, 2009
1 parent 0b4e4bb commit dd489fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions htroot/yacysearchitem.java
Expand Up @@ -115,6 +115,7 @@ public static serverObjects respond(final httpRequestHeader header, final server

prop.putHTML("content_title", result.title());
prop.putXML("content_title-xml", result.title());
prop.putJSON("content_title-json", result.title());
prop.putHTML("content_link", result.urlstring());
prop.put("content_display", display);
prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // aquire license for favicon url loading
Expand All @@ -141,8 +142,10 @@ public static serverObjects respond(final httpRequestHeader header, final server
((yacyURL.probablyRootURL(result.hash())) ? ", probablyRootURL" : "") +
(((wordURL = yacyURL.probablyWordURL(result.hash(), query[0])) != null) ? ", probablyWordURL=" + wordURL.toNormalform(false, true) : ""));
final plasmaSnippetCache.TextSnippet snippet = result.textSnippet();
prop.put("content_description", (snippet == null) ? "" : snippet.getLineMarked(theQuery.fullqueryHashes));
prop.putXML("content_description-xml", (snippet == null) ? "" : snippet.getLineMarked(theQuery.fullqueryHashes));
final String desc = snippet.getLineMarked(theQuery.fullqueryHashes);
prop.put("content_description", (snippet == null) ? "" : desc);
prop.putXML("content_description-xml", (snippet == null) ? "" : desc);
prop.putJSON("content_description-json", (snippet == null) ? "" : desc);
serverProfiling.update("SEARCH", new plasmaProfiling.searchEvent(theQuery.id(true), plasmaSearchEvent.FINALIZATION + "-" + item, 0, 0), false);

return prop;
Expand Down
4 changes: 2 additions & 2 deletions htroot/yacysearchitem.json
@@ -1,8 +1,8 @@
#(content)#::#(nl)#:: ,#(/nl)#
{
"title": "#[title]#",
"title": "#[title-json]#",
"link": "#[link]#",
"description": "#[description]#",
"description": "#[description-json]#",
"pubDate": "#[date822]#",
"size": "#[size]#",
"sizename": "#[sizename]#",
Expand Down

0 comments on commit dd489fc

Please sign in to comment.