better SRU compliance

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4976 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 3980dd7554
commit b38f467e3c

@ -24,17 +24,18 @@
<form class="search" action="yacysearch.html" method="get" id="searchform" accept-charset="UTF-8">
<fieldset class="maininput">
<input type="hidden" name="display" value="#[display]#" />
<input name="search" id="search" type="text" size="52" maxlength="80" value="#[former]#" />
<input name="query" id="search" type="text" size="52" maxlength="80" value="#[former]#" />
<input type="submit" name="Enter" value="Search" />
<input type="hidden" name="former" value="#[former]#" /><br />
<input type="hidden" name="verify" value="true" /><br />
<input type="radio" id="text" name="contentdom" value="text" #(contentdomCheckText)#::checked="checked"#(/contentdomCheckText)# /><label for="text">Text</label>&nbsp;&nbsp;
<input type="radio" id="image" name="contentdom" value="image" #(contentdomCheckImage)#::checked="checked"#(/contentdomCheckImage)# /><label for="image">Images</label>&nbsp;&nbsp;
<input type="radio" id="audio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# /><label for="audio">Audio</label>&nbsp;&nbsp;
<input type="radio" id="video" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# /><label for="video">Video</label>&nbsp;&nbsp;
<input type="radio" id="app" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# /><label for="app">Applications</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#(searchoptions)#
<input type="hidden" name="count" value="10" />
<input type="hidden" name="offset" value="0" />
<input type="hidden" name="maximumRecords" value="10" />
<input type="hidden" name="startRecord" value="0" />
<input type="hidden" name="resource" value="global" />
<input type="hidden" name="urlmaskfilter" value=".*" />
<input type="hidden" name="prefermaskfilter" value="" />

@ -25,12 +25,13 @@
::
<form class="search small" action="yacysearch.html" method="get" accept-charset="UTF-8">
<fieldset class="yacys">
<input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="search" name="query" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" />
<input type="hidden" name="contentdom" value="#[contentdom]#" />
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="count" value="#[count]#" />
<input type="hidden" name="offset" value="#[offset]#" />
<input type="hidden" name="verify" value="#[verify]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />
<input type="hidden" name="startRecord" value="#[offset]#" />
<input type="hidden" name="resource" value="#[resource]#" />
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" />
<input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" />
@ -47,7 +48,7 @@
<p class="yacylogo"><a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacy" /></a></p>
<h2>#[promoteSearchPageGreeting]#</h2>
<fieldset class="yacys">
<input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="search" name="query" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" /> &nbsp;
<a href="index.html?display=#[display]#&amp;input=#[input]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more options</a>
<div class="yacysearch">
@ -63,8 +64,9 @@
<label for="appl">Applications</label>
</div>
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="count" value="#[count]#" />
<input type="hidden" name="offset" value="#[offset]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />
<input type="hidden" name="startRecord" value="#[offset]#" />
<input type="hidden" name="verify" value="#[verify]#" />
<input type="hidden" name="resource" value="#[resource]#" />
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" />
<input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" />

@ -94,7 +94,7 @@ public class yacysearch {
// get query
String querystring = (post == null) ? "" : post.get("query", post.get("search", "")).trim(); // SRU compliance
boolean fetchSnippets = (post == null || post.get("verify", "true").equals("true"));
boolean fetchSnippets = (post != null && post.get("verify", "false").equals("true"));
final serverObjects prop = new serverObjects();
boolean rss = (post == null) ? false : post.get("rss", "false").equals("true");
@ -391,7 +391,7 @@ public class yacysearch {
}
if (prop == null || prop.size() == 0) {
if (post == null || post.get("search", "").length() < 3) {
if (post == null || post.get("query", post.get("search", "")).length() < 3) {
prop.put("num-results", "2"); // no results - at least 3 chars
} else {
prop.put("num-results", "1"); // no results
@ -416,7 +416,6 @@ public class yacysearch {
prop.put("input_input", input);
prop.put("input_display", display);
prop.putHTML("input_former", querystring);
//prop.put("former", post.get("search", ""));
prop.put("input_count", itemsPerPage);
prop.put("input_offset", offset);
prop.put("input_resource", global ? "global" : "local");
@ -446,8 +445,8 @@ public class yacysearch {
return
"<a href=\"yacysearch.html?display=" + display +
"&amp;search=" + theQuery.queryString(true) +
"&amp;count="+ theQuery.displayResults() +
"&amp;offset=" + (page * theQuery.displayResults()) +
"&amp;maximumRecords="+ theQuery.displayResults() +
"&amp;startRecord=" + (page * theQuery.displayResults()) +
"&amp;resource=" + ((theQuery.isLocal()) ? "local" : "global") +
"&amp;urlmaskfilter=" + theQuery.urlMask +
"&amp;prefermaskfilter=" + theQuery.prefer +

@ -225,7 +225,7 @@ public class yacysearchitem {
((yacyURL.probablyRootURL(result.hash())) ? ", probablyRootURL" : "") +
(((wordURL = yacyURL.probablyWordURL(result.hash(), query[0])) != null) ? ", probablyWordURL=" + wordURL.toNormalform(false, true) : ""));
plasmaSnippetCache.TextSnippet snippet = result.textSnippet();
prop.put("content_snippet", (snippet == null) ? "(snippet not found)" : snippet.getLineMarked(theQuery.queryHashes));
prop.put("content_snippet", (snippet == null) ? "" : snippet.getLineMarked(theQuery.queryHashes));
serverProfiling.update("SEARCH", new plasmaProfiling.searchEvent(theQuery.id(true), plasmaSearchEvent.FINALIZATION + "-" + item, 0, 0));
return prop;

@ -294,9 +294,10 @@ public class kelondroCollectionIndex {
boolean fullCache = serverMemory.request(necessaryRAM4fullTable, false);
if (fullCache) {
theindex = new kelondroEcoTable(f, indexRowdef, kelondroEcoTable.tailCacheUsageAuto, EcoFSBufferSize, initialSpace);
if (!((kelondroEcoTable) theindex).usesFullCopy()) theindex = new kelondroCache(theindex);
//if (!((kelondroEcoTable) theindex).usesFullCopy()) theindex = new kelondroCache(theindex);
} else {
theindex = new kelondroCache(new kelondroEcoTable(f, indexRowdef, kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, initialSpace));
//theindex = new kelondroCache(new kelondroEcoTable(f, indexRowdef, kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, initialSpace));
theindex = new kelondroEcoTable(f, indexRowdef, kelondroEcoTable.tailCacheDenyUsage, EcoFSBufferSize, initialSpace);
}
}
return theindex;

@ -289,7 +289,7 @@ public final class plasmaSearchRankingProcess {
// finally remove the best entry from the doubledom cache
m = this.doubleDomCache.get(bestEntry.element.urlHash().substring(6));
o = m.pop();
assert o.element.urlHash().equals(bestEntry.element.urlHash());
assert o == null || o.element.urlHash().equals(bestEntry.element.urlHash());
return bestEntry;
}

Loading…
Cancel
Save