fixed search performance / dynamic display of results

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4557 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 17 years ago
parent d87d295c68
commit f63bd26268

@ -20,25 +20,22 @@
<script src="js/jquery.field.min.js" type="text/javascript"></script> <script src="js/jquery.field.min.js" type="text/javascript"></script>
<script src="js/ui.tabs.min.js" type="text/javascript"></script> <script src="js/ui.tabs.min.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(function() {
$('#container > ul').tabs(); var $tabs = $('#container > ul').tabs();
insert_sidebar(); insert_sidebar();
$('#searchbox').submit(function() { $('#searchbox').submit(function() {
var tabnr = $('#container > ul').tabs('length'); var tabnr = $('#container > ul').tabs('length');
var result = "result.html?" + $('#searchbox').formSerialize(); var result = "result.html?" + $('#searchbox').formSerialize();
var tabname = "*" + $("input[@name='search']").getValue(); var tabname = $("input[@name='search']").getValue();
$('#container > ul').tabs('add', '#empty', tabname); $('<div id='+tabname+'</div>').appendTo('#container');
$('#container > ul').tabs('select', tabnr); $tabs.tabs('add', result, '*'+tabname);
$('#container > ul').tabs('url', tabnr, result); $tabs.tabs('select',tabnr);
$('#container > ul').tabs('load', tabnr);
return false; return false;
}); });
}); });
function insert_sidebar() { function insert_sidebar() {
$('<div id="pager" class="boxed"></div>').appendTo('#sidebar') $('<div id="pager" class="boxed"></div>').appendTo('#sidebar')
$("#pager").load("sidebar/sidebar_pager.html"); $("#pager").load("sidebar/sidebar_pager.html");
$('<div id="example" class="boxed"></div>').appendTo('#sidebar')
$("#example").load("sidebar/sidebar.html");
} }
</script> </script>
</head> </head>
@ -95,8 +92,7 @@
<ul> <ul>
<li><a href="welcome.html" title="Welcome"><span>Welcome</span></a></li> <li><a href="welcome.html" title="Welcome"><span>Welcome</span></a></li>
<li><a href="ymarks.html" title="Ymarks"><span>Y-Marks</span></a></li> <li><a href="ymarks.html" title="Ymarks"><span>Y-Marks</span></a></li>
</ul> </ul>
<div id="empty"></div>
</div> </div>
<div id="sidebar" class="sidebar"><!-- Sidebar wird dynamisch geladen --></div> <div id="sidebar" class="sidebar"><!-- Sidebar wird dynamisch geladen --></div>
</body> </body>

@ -1,18 +1,22 @@
<script type="text/javascript"> <div id="#[ID]#"></div>
$(document).ready(function() {
var url = "/yacy/user/sidebar_history.html?eventID=#[eventID]#";
$('<div id="history" class="boxed"></div>').appendTo('#sidebar')
$("#history").load(url);
});
</script>
<!-- linklist begin --> <!-- linklist begin -->
#(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</tr>#(/resultTable)# #(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</tr>#(/resultTable)#
#{results}# #{results}#
<!--#include virtual="/yacy/user/ysearchitem.html?rss=false&item=#[item]#&eventID=#[eventID]#" --> <script type="text/javascript">
$(function() {
var id = "#"+"#[ID]#";
$.get("/yacy/ui/ritem.html?rss=false&item=#[item]#&eventID=#[eventID]#", function(html) {
$(id).append(html);
$(id).trigger("update");
});
});
</script>
#{/results}# #{/results}#
#(resultTable)#::</table>#(/resultTable)# #(resultTable)#::</table>#(/resultTable)#
/yacy/user/sidebar_history.html?eventID=#[eventID]#

@ -123,6 +123,8 @@ public class result {
constraint.set(plasmaCondenser.flag_cat_indexof, true); constraint.set(plasmaCondenser.flag_cat_indexof, true);
} }
int domainzone = post.getInt("zone", yacyURL.TLD_any_zone_filter);
// SEARCH // SEARCH
//final boolean indexDistributeGranted = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true"); //final boolean indexDistributeGranted = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true");
//final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true"); //final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true");
@ -182,7 +184,7 @@ public class result {
20, 20,
constraint, constraint,
true, true,
yacyURL.TLD_any_zone_filter, domainzone,
client); client);
@ -241,10 +243,12 @@ public class result {
for (int i = 0; i < theQuery.displayResults(); i++) { for (int i = 0; i < theQuery.displayResults(); i++) {
prop.put("results_" + i + "_item", offset + i); prop.put("results_" + i + "_item", offset + i);
prop.put("results_" + i + "_eventID", theQuery.id(false)); prop.put("results_" + i + "_eventID", theQuery.id(false));
prop.put("results_" + i + "_ID", theQuery.id(false).substring(1,6));
} }
prop.put("results", theQuery.displayResults()); prop.put("results", theQuery.displayResults());
prop.put("resultTable", (contentdomCode <= 1) ? "0" : "1"); prop.put("resultTable", (contentdomCode <= 1) ? "0" : "1");
prop.put("eventID", theQuery.id(false)); // for bottomline prop.put("eventID", theQuery.id(false)); // for bottomline
prop.put("ID", theQuery.id(false).substring(1,6)); // for bottomline
// process result of search // process result of search
if (filtered.size() > 0) { if (filtered.size() > 0) {
@ -300,8 +304,8 @@ public class result {
prop.putHTML("rss_query", querystring, true); prop.putHTML("rss_query", querystring, true);
prop.put("rss_queryenc", yacyURL.escape(querystring.replace(' ', '+'))); prop.put("rss_queryenc", yacyURL.escape(querystring.replace(' ', '+')));
sb.localSearchLastAccess = System.currentTimeMillis(); sb.localSearchLastAccess = System.currentTimeMillis();
// return rewrite properties // return rewrite properties
return prop; return prop;
} }

Loading…
Cancel
Save