Use final results counts in progress bar detailed statistics.

Using unfiltered detailed counts (local and remote entries found before
doubles detection and before applying query modifiers) was confusing and
inconsistent with the total count. It could let think more results are
to come in the next pages, without understanding why they are not
displayed.
This commit is contained in:
luccioman 2017-08-31 07:37:24 +02:00
parent 2f71005a93
commit 30c2f50e0b
14 changed files with 68 additions and 50 deletions

View File

@ -44,7 +44,7 @@ function fadeOutBar() {
/** /**
* @returns pagination buttons * @returns pagination buttons
*/ */
function renderPaginationButtons(offset, itemscount, itemsperpage, totalcount, localResourceSize, remoteResourceSize, remoteIndexCount, remotePeerCount, navurlbase, localQuery) { function renderPaginationButtons(offset, itemsperpage, totalcount, navurlbase, localQuery) {
var resnav = "<ul class=\"pagination\">"; var resnav = "<ul class=\"pagination\">";
var thispage = Math.floor(offset / itemsperpage); var thispage = Math.floor(offset / itemsperpage);
var firstPage = thispage - (thispage % 10); var firstPage = thispage - (thispage % 10);
@ -95,7 +95,7 @@ function parseFormattedInt(strIntValue) {
return intValue; return intValue;
} }
function statistics(offset, itemscount, itemsperpage, totalcount, localResourceSize, remoteResourceSize, remoteIndexCount, remotePeerCount, navurlbase, localQuery, feedRunning) { function statistics(offset, itemscount, itemsperpage, totalcount, localIndexCount, remoteIndexCount, remotePeerCount, navurlbase, localQuery, feedRunning) {
var totalcountIntValue = parseFormattedInt(totalcount); var totalcountIntValue = parseFormattedInt(totalcount);
var offsetIntValue = parseFormattedInt(offset); var offsetIntValue = parseFormattedInt(offset);
var itemscountIntValue = parseFormattedInt(itemscount); var itemscountIntValue = parseFormattedInt(itemscount);
@ -124,17 +124,43 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
if (totalcountIntValue == 0) { if (totalcountIntValue == 0) {
return; return;
} }
var progresseBarElement = document.getElementById("progressbar"); var elementToUpdate = document.getElementById("offset");
if (offsetIntValue >= 0) document.getElementById("offset").innerHTML = offset; if (offsetIntValue >= 0 && elementToUpdate != null) {
if (offsetIntValue >= 0) document.getElementById("startRecord").setAttribute('value', offsetIntValue - 1); elementToUpdate.innerHTML = offset;
if (itemscountIntValue >= 0) document.getElementById("itemscount").firstChild.nodeValue = itemscount; }
document.getElementById("totalcount").firstChild.nodeValue = totalcount;
if (document.getElementById("localResourceSize") != null) document.getElementById("localResourceSize").firstChild.nodeValue = localResourceSize; elementToUpdate = document.getElementById("startRecord");
if (document.getElementById("remoteResourceSize") != null) document.getElementById("remoteResourceSize").firstChild.nodeValue = remoteResourceSize; if (offsetIntValue >= 0 && elementToUpdate != null) {
if (document.getElementById("remoteIndexCount") != null) document.getElementById("remoteIndexCount").firstChild.nodeValue = remoteIndexCount; elementToUpdate.setAttribute('value', offsetIntValue - 1);
if (document.getElementById("remotePeerCount") != null) document.getElementById("remotePeerCount").firstChild.nodeValue = remotePeerCount; }
elementToUpdate = document.getElementById("itemscount");
if (itemscountIntValue >= 0 && elementToUpdate != null) {
elementToUpdate.firstChild.nodeValue = itemscount;
}
elementToUpdate = document.getElementById("totalcount");
if(elementToUpdate != null) {
elementToUpdate.firstChild.nodeValue = totalcount;
}
elementToUpdate = document.getElementById("localIndexCount");
if (elementToUpdate != null) {
elementToUpdate.firstChild.nodeValue = localIndexCount;
}
elementToUpdate = document.getElementById("remoteIndexCount");
if (elementToUpdate != null) {
elementToUpdate.firstChild.nodeValue = remoteIndexCount;
}
elementToUpdate = document.getElementById("remotePeerCount");
if (elementToUpdate != null) {
elementToUpdate.firstChild.nodeValue = remotePeerCount;
}
// compose page navigation // compose page navigation
var progresseBarElement = document.getElementById("progressbar");
if (progresseBarElement.getAttribute('class') != "progress-bar progress-bar-success") { if (progresseBarElement.getAttribute('class') != "progress-bar progress-bar-success") {
var percent = 100 * (itemscountIntValue - offsetIntValue + 1) / itemsperpageIntValue; var percent = 100 * (itemscountIntValue - offsetIntValue + 1) / itemsperpageIntValue;
if (percent == 100) { if (percent == 100) {
@ -148,9 +174,7 @@ function statistics(offset, itemscount, itemsperpage, totalcount, localResourceS
} }
var resnavElement = document.getElementById("resNav"); var resnavElement = document.getElementById("resNav");
if (resnavElement != null) { if (resnavElement != null) {
resnavElement.innerHTML = renderPaginationButtons(offsetIntValue, itemscountIntValue, itemsperpageIntValue, resnavElement.innerHTML = renderPaginationButtons(offsetIntValue, itemsperpageIntValue, totalcountIntValue, navurlbase, localQuery);
totalcountIntValue, parseFormattedInt(localResourceSize), parseFormattedInt(remoteResourceSize), parseFormattedInt(remoteIndexCount),
parseFormattedInt(remotePeerCount), navurlbase, localQuery);
} }
} }

View File

@ -112,7 +112,8 @@ Use the RSS search result format to add static searches to your RSS reader, if y
<div id="results"></div> <div id="results"></div>
<div class="progress"> <div class="progress">
<div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%;"> <div class="progress-bar progress-bar-info" id="progressbar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%;">
<span style="position:absolute;display:block;text-align:left;width:85%;color:black;">&nbsp;&nbsp;&nbsp;<strong id="offset">#[offset]#</strong>-<strong id="itemscount">#[itemscount]#</strong> of <strong id="totalcount">#[totalcount]#</strong> #(globalresults)#::; (<strong id="localResourceSize">#[localResourceSize]#</strong> local, <strong id="remoteResourceSize">#[remoteResourceSize]#</strong> remote), <strong id="remoteIndexCount">#[remoteIndexCount]#</strong> from <strong id="remotePeerCount">#[remotePeerCount]#</strong> remote YaCy peers.#(/globalresults)# <span style="position:absolute;display:block;text-align:left;width:85%;color:black;">&nbsp;&nbsp;&nbsp;<strong id="offset">#[offset]#</strong>-<strong id="itemscount">#[itemscount]#</strong> of <strong id="totalcount">#[totalcount]#</strong>
#(globalresults)#::; (<strong id="localIndexCount">#[localIndexCount]#</strong> local, <strong id="remoteIndexCount">#[remoteIndexCount]#</strong> remote from <strong id="remotePeerCount">#[remotePeerCount]#</strong> YaCy peers).#(/globalresults)#
<span id="feedingStatus" style="visibility: hidden;" class="glyphicon glyphicon-transfer" title="YaCy server is fetching results from available data sources."></span> <span id="feedingStatus" style="visibility: hidden;" class="glyphicon glyphicon-transfer" title="YaCy server is fetching results from available data sources."></span>
</span> </span>
</div> </div>
@ -221,7 +222,7 @@ function latestinfo() {
} }
if(rsp && rsp.offset != null) { if(rsp && rsp.offset != null) {
statistics(rsp.offset, rsp.itemscount, rsp.itemsperpage, rsp.totalcount, rsp.localResourceSize, rsp.remoteResourceSize, rsp.remoteIndexCount, rsp.remotePeerCount, rsp.navurlBase, #[localQuery]#, rsp.feedRunning); statistics(rsp.offset, rsp.itemscount, rsp.itemsperpage, rsp.totalcount, rsp.localIndexCount, rsp.remoteIndexCount, rsp.remotePeerCount, rsp.navurlBase, #[localQuery]#, rsp.feedRunning);
if(rsp.feedRunning) { if(rsp.feedRunning) {
/* Refresh statistics while server feeders are still running */ /* Refresh statistics while server feeders are still running */
window.setTimeout(latestinfo, 1000); window.setTimeout(latestinfo, 1000);

View File

@ -823,7 +823,7 @@ public class yacysearch {
prop.put("num-results_itemsPerPage", Formatter.number(itemsPerPage)); prop.put("num-results_itemsPerPage", Formatter.number(itemsPerPage));
prop.put("num-results_totalcount", Formatter.number(theSearch.getResultCount())); // also in yacyserchtrailer (hint: timing in p2p search ) prop.put("num-results_totalcount", Formatter.number(theSearch.getResultCount())); // also in yacyserchtrailer (hint: timing in p2p search )
prop.put("num-results_globalresults", global && (indexReceiveGranted || clustersearch) ? "1" : "0"); prop.put("num-results_globalresults", global && (indexReceiveGranted || clustersearch) ? "1" : "0");
prop.put("num-results_globalresults_localResourceSize", Formatter.number(theSearch.local_rwi_stored.get() + theSearch.local_solr_stored.get(), true)); prop.put("num-results_globalresults_localIndexCount", Formatter.number(theSearch.local_rwi_stored.get() + theSearch.local_solr_stored.get(), true));
prop.put("num-results_globalresults_remoteResourceSize", Formatter.number(theSearch.remote_rwi_stored.get() + theSearch.remote_solr_stored.get(), true)); prop.put("num-results_globalresults_remoteResourceSize", Formatter.number(theSearch.remote_rwi_stored.get() + theSearch.remote_solr_stored.get(), true));
prop.put("num-results_globalresults_remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true)); prop.put("num-results_globalresults_remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true));
prop.put("num-results_globalresults_remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true)); prop.put("num-results_globalresults_remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true));

View File

@ -59,6 +59,6 @@
#(statistics)#:: #(statistics)#::
<script type="text/javascript"> <script type="text/javascript">
statistics("#[offset]#", "#[itemscount]#", "#[itemsperpage]#", "#[totalcount]#", "#[localResourceSize]#", "#[remoteResourceSize]#", "#[remoteIndexCount]#", "#[remotePeerCount]#", "#[navurlBase]#", #[localQuery]#, #[feedRunning]#); statistics("#[offset]#", "#[itemscount]#", "#[itemsperpage]#", "#[totalcount]#", "#[localIndexCount]#", "#[remoteIndexCount]#", "#[remotePeerCount]#", "#[navurlBase]#", #[localQuery]#, #[feedRunning]#);
</script> </script>
#(/statistics)# #(/statistics)#

View File

@ -118,8 +118,7 @@ public class yacysearchitem {
prop.put("statistics_itemscount", Formatter.number(Math.min((item < 0) ? theSearch.query.neededResults() : item + 1, theSearch.getResultCount()))); prop.put("statistics_itemscount", Formatter.number(Math.min((item < 0) ? theSearch.query.neededResults() : item + 1, theSearch.getResultCount())));
prop.put("statistics_itemsperpage", Formatter.number(theSearch.query.itemsPerPage)); prop.put("statistics_itemsperpage", Formatter.number(theSearch.query.itemsPerPage));
prop.put("statistics_totalcount", Formatter.number(theSearch.getResultCount(), true)); prop.put("statistics_totalcount", Formatter.number(theSearch.getResultCount(), true));
prop.put("statistics_localResourceSize", Formatter.number(theSearch.local_rwi_stored.get() + theSearch.local_solr_stored.get(), true)); prop.put("statistics_localIndexCount", Formatter.number(theSearch.local_rwi_available.get() + theSearch.local_solr_available.get(), true));
prop.put("statistics_remoteResourceSize", Formatter.number(theSearch.remote_rwi_stored.get() + theSearch.remote_solr_stored.get(), true));
prop.put("statistics_remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true)); prop.put("statistics_remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true));
prop.put("statistics_remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true)); prop.put("statistics_remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true));
prop.put("statistics_navurlBase", QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false).toString()); prop.put("statistics_navurlBase", QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false).toString());

View File

@ -24,6 +24,7 @@ public class yacysearchlatestinfo {
prop.put("itemsperpage", 10); prop.put("itemsperpage", 10);
prop.put("totalcount", 0); prop.put("totalcount", 0);
prop.put("localResourceSize", 0); prop.put("localResourceSize", 0);
prop.put("localIndexCount", 0);
prop.put("remoteResourceSize", 0); prop.put("remoteResourceSize", 0);
prop.put("remoteIndexCount", 0); prop.put("remoteIndexCount", 0);
prop.put("remotePeerCount", 0); prop.put("remotePeerCount", 0);
@ -39,6 +40,7 @@ public class yacysearchlatestinfo {
prop.put("itemsperpage", theSearch.query.itemsPerPage); prop.put("itemsperpage", theSearch.query.itemsPerPage);
prop.put("totalcount", Formatter.number(theSearch.getResultCount(), true)); prop.put("totalcount", Formatter.number(theSearch.getResultCount(), true));
prop.put("localResourceSize", Formatter.number(theSearch.local_rwi_stored.get() + theSearch.local_solr_stored.get(), true)); prop.put("localResourceSize", Formatter.number(theSearch.local_rwi_stored.get() + theSearch.local_solr_stored.get(), true));
prop.put("localIndexCount", Formatter.number(theSearch.local_rwi_available.get() + theSearch.local_solr_available.get(), true));
prop.put("remoteResourceSize", Formatter.number(theSearch.remote_rwi_stored.get() + theSearch.remote_solr_stored.get(), true)); prop.put("remoteResourceSize", Formatter.number(theSearch.remote_rwi_stored.get() + theSearch.remote_solr_stored.get(), true));
prop.put("remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true)); prop.put("remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true));
prop.put("remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true)); prop.put("remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true));

View File

@ -4,6 +4,7 @@
"itemsperpage": "#[itemsperpage]#", "itemsperpage": "#[itemsperpage]#",
"totalcount": "#[totalcount]#", "totalcount": "#[totalcount]#",
"localResourceSize": "#[localResourceSize]#", "localResourceSize": "#[localResourceSize]#",
"localIndexCount": "#[localIndexCount]#",
"remoteResourceSize": "#[remoteResourceSize]#", "remoteResourceSize": "#[remoteResourceSize]#",
"remoteIndexCount": "#[remoteIndexCount]#", "remoteIndexCount": "#[remoteIndexCount]#",
"remotePeerCount": "#[remotePeerCount]#", "remotePeerCount": "#[remotePeerCount]#",

View File

@ -3192,10 +3192,9 @@ The following words are stop-words and had been excluded from the search:==以
No Results.==未找到. No Results.==未找到.
length of search words must be at least 3 characters==搜索关键字至少为3个字符 length of search words must be at least 3 characters==搜索关键字至少为3个字符
> of==> 共 > of==> 共
g> local,==g> 本地, > local,==> 本地,
#g> remote),==g> remote), remote from==远端 来自
> from==> 来自 YaCy peers).==YaCy peer).
remote YaCy peers.==远端YaCy peer.
#----------------------------- #-----------------------------
#File: yacysearchitem.html #File: yacysearchitem.html

View File

@ -3757,10 +3757,9 @@ and contributors, CC-BY-SA==und Mitwirkenden, CC-BY-SA Lizenz
>Media<==>Medium< >Media<==>Medium<
#>URL<==>URL< #>URL<==>URL<
> of==> aus > of==> aus
g> local,==g> lokal, > local,==> lokal,
#g> remote),==g> remote), remote from==remote von
> from==> von YaCy peers).==YaCy Peers).
remote YaCy peers.==remote YaCy Peers.
#----------------------------- #-----------------------------
#File: yacysearchitem.html #File: yacysearchitem.html

View File

@ -2464,10 +2464,9 @@ Use the RSS search result format to add static searches to your RSS reader, if y
No Results.==Pas de r&eacute;sultats. No Results.==Pas de r&eacute;sultats.
length of search words must be at least 1 character==les termes recherch&eacute;s doivent contenir au moins un caract&egrave;re length of search words must be at least 1 character==les termes recherch&eacute;s doivent contenir au moins un caract&egrave;re
> of <==> de < > of <==> de <
local, == locaux, > local,==> locaux,
remote), == distants), remote from== distants de
> from <==> de < YaCy peers).== noeuds YaCy).
remote YaCy peers.== noeuds YaCy distants.
Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function==La recherche avec ce noeud est d&eacute;sactiv&eacute;e pour les utilisateurs non autoris&eacute;s. Veuillez vous <a href="Status.html?login=">connecter</a> en tant qu'administrateur pour utiliser la fonction de recherche. Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function==La recherche avec ce noeud est d&eacute;sactiv&eacute;e pour les utilisateurs non autoris&eacute;s. Veuillez vous <a href="Status.html?login=">connecter</a> en tant qu'administrateur pour utiliser la fonction de recherche.
Illegal URL mask:==Masque d'URL incorrect : Illegal URL mask:==Masque d'URL incorrect :
(not a valid regular expression), mask ignored.==(expression r&eacute;guli&egrave;re incorrecte), masque ignor&eacute;. (not a valid regular expression), mask ignored.==(expression r&eacute;guli&egrave;re incorrecte), masque ignor&eacute;.

View File

@ -1470,10 +1470,9 @@ and contributors, CC-BY-SA==そしてコントリビューター, CC-BY-SA
>Media<==>メディア< >Media<==>メディア<
#>URL<==>URL< #>URL<==>URL<
> of==> of > of==> of
g> local,==g> ローカル, > local,==> ローカル,
#g> remote),==g> リモート), remote from==リモート from
> from==> from YaCy peers).==のYaCy ピア).
remote YaCy peers.==リモートのYaCy ピア.
#----------------------------- #-----------------------------
#File: yacysearchitem.html #File: yacysearchitem.html

View File

@ -11526,16 +11526,13 @@
<source>&gt; of</source> <source>&gt; of</source>
</trans-unit> </trans-unit>
<trans-unit id="2b6efdaa" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="2b6efdaa" xml:space="preserve" approved="no" translate="yes">
<source>g&gt; local,</source> <source>&gt; local,</source>
</trans-unit> </trans-unit>
<trans-unit id="7bc93532" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="7bc93532" xml:space="preserve" approved="no" translate="yes">
<source>g&gt; remote),</source> <source>remote from</source>
</trans-unit>
<trans-unit id="6bbf7e4c" xml:space="preserve" approved="no" translate="yes">
<source>&gt; from</source>
</trans-unit> </trans-unit>
<trans-unit id="61f1c6c5" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="61f1c6c5" xml:space="preserve" approved="no" translate="yes">
<source>remote YaCy peers.</source> <source>YaCy peers).</source>
</trans-unit> </trans-unit>
<trans-unit id="9ddb2d96" xml:space="preserve" approved="no" translate="yes"> <trans-unit id="9ddb2d96" xml:space="preserve" approved="no" translate="yes">
<source>&gt;search&lt;</source> <source>&gt;search&lt;</source>

View File

@ -4087,10 +4087,9 @@ and contributors, CC-BY-SA==и участники, лицензия CC-BY-SA
>Media<==>Медиа< >Media<==>Медиа<
#>URL<==>URL-адрес< #>URL<==>URL-адрес<
> of==> из > of==> из
g> local,==g> локально, > local,==> локально,
g> remote),==g> удалённо), remote from==удалённо из
> from==> из YaCy peers).==узлов YaCy).
remote YaCy peers.==удалённых узлов YaCy.
>search<==>Поиск< >search<==>Поиск<
#----------------------------- #-----------------------------

View File

@ -3408,10 +3408,9 @@ length of search words must be at least==Довжина пошукового з
d+ characters==d+ знаків d+ characters==d+ знаків
> of==> з > of==> з
g> local,==g> локально, > local,==> локально,
g> remote),==g> віддалених), remote from==віддалених з
> from==> з YaCy peers).==вузлів YaCy).
remote YaCy peers.==віддалених вузлів YaCy.
#----------------------------- #-----------------------------
#File: yacysearchitem.html #File: yacysearchitem.html