diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index f924c6dbf..f38b0b0ca 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -1,214 +1,192 @@ - YaCy '#[clientname]#': Search Page - #%env/templates/metas.template%# - - - - - + YaCy '#[clientname]#': Search Page + #%env/templates/metas.template%# + + + + + #(display)# -#%env/templates/simpleheader.template%# -:: -#%env/templates/header.template%# + #%env/templates/simpleheader.template%# + :: + #%env/templates/header.template%# #(/display)# - + + -#(type)# - + #(excluded)# -:: -

The following words are stop-words and had been excluded from the search: #[stopwords]#.

+ :: +

The following words are stop-words and had been excluded from the search: #[stopwords]#.

#(/excluded)# -#(num-results)# -:: -

No Results.

-:: -

No Results. (length of search words must be at least 3 characters)

-:: -

No Results. If you think this is unsatisfactory then you may consider to support the global index by running your own proxy/peer. -If everybody contributes, the results will get better.

-

Other possible reasons for no result:

-

-

If you think the information you searched should exist in the global index, -then please run your own peer and start a crawl of your wanted information to make it -available for everyone. Then stay online to support crawls from other peers. Thank you!

-:: -

#[linkcount]# results from #[orderedcount]# ordered links of a total number of #[totalcount]# known.

-#(/num-results)# -#(combine)# -:: -

Refine your search with these topwords:

-

-#{words}# -#[word]# -#{/words}# -

-#(/combine)# - - -#{results}# - -
-
- bookmark - #(recommend)# - - - :: - recommend - delete - #(/recommend)# -
-

#[description]#

-

#(snippet)#loading snippet ...::#[text]##(/snippet)#

-

#[urlname]#

-

#[date]# | YBR-#[ybr]# | Info | Pictures

-
- -#{/results}# - - - -

-#(resultbottomline)# -:: -The global search resulted in #[globalresults]# link contributions from other YaCy peers. -:: -You can enrich the search results by using the 'global' option: This will search also other YaCy peers -:: -You cannot get global search results because you are not connected to another YaCy peer. -To connect you must first use the proxy. -See here for an installation guide. -Alternatively, you can run the proxy in permanent online mode, which also grants global search. -To do this, press this button:

-
- -
-

-:: -You can enrich the search results by using the 'global' option; you must also switch to online mode -(by using the proxy) to contribute to the global index. -#(/resultbottomline)# -

-:: -#(excluded)# -:: -

The following words are stop-words and had been excluded from the search: #[stopwords]#.

-#(/excluded)# + #(num-results)# -:: -

No Results.

-:: -

No Results. (length of search words must be at least 3 characters)

-:: -

No Results. If you think this is unsatisfactory then you may consider to support the global index by running your own proxy/peer. -If everybody contributes, the results will get better.

-

Other possible reasons for no result:

-

-

If you think the information you searched should exist in the global index, -then please run your own peer and start a crawl of your wanted information to make it -available for everyone. Then stay online to support crawls from other peers. Thank you!

-:: -

#[linkcount]# results from #[orderedcount]# ordered links of a total number of #[totalcount]# known.

+ :: +

No Results.

+ :: +

No Results. (length of search words must be at least 3 characters)

+ :: +

No Results. If you think this is unsatisfactory then you may consider to support the global index by running your own proxy/peer. + If everybody contributes, the results will get better.

+

Other possible reasons for no result:

+

+

If you think the information you searched should exist in the global index, + then please run your own peer and start a crawl of your wanted information to make it + available for everyone. Then stay online to support crawls from other peers. Thank you!

+ :: +

#[linkcount]# results from #[orderedcount]# ordered links from #[filteredcount]# filtered links of a total number of #[totalcount]# known.

#(/num-results)# - -#{results}# - - loading snippet from #[urlname]#
- -#{/results}# - - -:: -:: - -#{results}# - -#{line}# - -#{/line}# - -#{/results}# -
-
#[name]# -
+ +#(type)# + + #(combine)# + :: +

Refine your search with these topwords:

+

+ #{words}# + #[word]# + #{/words}# +

+ #(/combine)# + + + #{results}# + +
+
+ bookmark + #(recommend)# + + + :: + recommend + delete + #(/recommend)# +
+

#[description]#

+

#(snippet)#loading snippet ...::#[text]##(/snippet)#

+

#[urlname]#

+

#[date]# | YBR-#[ybr]# | Info | Pictures

+
+ + #{/results}# + + + + +

+ #(resultbottomline)# + :: + The global search resulted in #[globalresults]# link contributions from other YaCy peers. + :: + You can enrich the search results by using the 'global' option: This will search also other YaCy peers + :: + You cannot get global search results because you are not connected to another YaCy peer. + To connect you must first use the proxy. + See here for an installation guide. + Alternatively, you can run the proxy in permanent online mode, which also grants global search. + To do this, press this button:

+
+ +
+

+ :: + You can enrich the search results by using the 'global' option; you must also switch to online mode + (by using the proxy) to contribute to the global index. + #(/resultbottomline)# +

+ :: + + #{results}# + + loading snippet from #[urlname]#
+ + #{/results}# + + + + :: + :: + + #{results}# + + #{line}# + + #{/line}# + + #{/results}# +
+
#[name]# +
#(/type)# +

YaCy is a GPL'ed project with the target of implementing a P2P-based global search engine.
Architecture (C) by Michael Peter Christen, Mail-Adresse von Michael Peter Christen

#(display)# -#%env/templates/simplefooter.template%# -:: -#%env/templates/footer.template%# + #%env/templates/simplefooter.template%# + :: + #%env/templates/footer.template%# #(/display)# diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 1a4cc5761..179dd85f8 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -281,28 +281,23 @@ public class yacysearch { // process result of search prop.put("type_resultbottomline", 0); if (filtered.size() > 0) { - prop.put("type_excluded", 1); - prop.put("type_excluded_stopwords", filtered.toString()); + prop.put("excluded", 1); + prop.put("excluded_stopwords", filtered.toString()); } else { - prop.put("type_excluded", 0); + prop.put("excluded", 0); } if (prop == null || prop.size() == 0) { if (post.get("search", "").length() < 3) { - prop.put("type_num-results", 2); // no results - at least 3 chars + prop.put("num-results", 2); // no results - at least 3 chars } else { - prop.put("type_num-results", 1); // no results + prop.put("num-results", 1); // no results } } else { - final int linkcount = Integer.parseInt(prop.get("type_linkcount", "0")); - final int orderedcount = Integer.parseInt(prop.get("type_orderedcount", "0")); - final int totalcount = Integer.parseInt(prop.get("type_totalcount", "0")); - if (totalcount > 10) { - final Object[] references = (Object[]) prop.get( "type_references", new String[0]); - prop.put("type_num-results", 4); - prop.put("type_num-results_linkcount", linkcount); - prop.put("type_num-results_orderedcount", orderedcount); - prop.put("type_num-results_totalcount", totalcount); + final int totalcount = Integer.parseInt(prop.get("num-results_totalcount", "0")); + if (totalcount >= 10) { + final Object[] references = (Object[]) prop.get( "references", new String[0]); + prop.put("num-results", 4); int hintcount = references.length; if (hintcount > 0) { @@ -346,12 +341,9 @@ public class yacysearch { } } else { if (totalcount == 0) { - prop.put("type_num-results", 3); // long + prop.put("num-results", 3); // long } else { - prop.put("type_num-results", 4); - prop.put("type_num-results_linkcount", linkcount); - prop.put("type_num-results_orderedcount", orderedcount); - prop.put("type_num-results_totalcount", totalcount); + prop.put("num-results", 4); } } } diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java index 8cfd1ebd1..c2fef7c06 100644 --- a/source/de/anomic/plasma/plasmaSearchEvent.java +++ b/source/de/anomic/plasma/plasmaSearchEvent.java @@ -198,7 +198,6 @@ public final class plasmaSearchEvent extends Thread implements Runnable { plasmaSearchResult result = orderFinal(rcLocal); if (result != null) { result.globalContributions = globalContributions; - result.localContributions = (rcLocal == null) ? 0 : rcLocal.size(); // flush results in a separate thread this.start(); // start to flush results @@ -212,7 +211,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable { Map searchContainerMap = localSearchContainers(null); indexContainer rcLocal = (searchContainerMap == null) ? wordIndex.emptyContainer(null) : localSearchJoin(searchContainerMap.values()); plasmaSearchResult result = orderFinal(rcLocal); - result.localContributions = rcLocal.size(); + result.globalContributions = 0; // return search result log.logFine("SEARCHRESULT: " + profileLocal.reportToString()); @@ -378,9 +377,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable { long postorderLimitTime = (postorderTime < 0) ? Long.MAX_VALUE : (System.currentTimeMillis() + postorderTime); profileLocal.startTimer(); plasmaSearchResult acc = new plasmaSearchResult(query, ranking); - //if (searchResult == null) return acc; // strange case where searchResult is not proper: acc is then empty - //if (searchResult.size() == 0) return acc; // case that we have nothing to do - + indexRWIEntryNew entry; indexURLEntry page; Long preranking; @@ -432,6 +429,8 @@ public final class plasmaSearchEvent extends Thread implements Runnable { profileLocal.setYieldTime(plasmaSearchTimingProfile.PROCESS_FILTER); profileLocal.setYieldCount(plasmaSearchTimingProfile.PROCESS_FILTER, acc.sizeOrdered()); + acc.localContributions = (rcLocal == null) ? 0 : rcLocal.size(); + acc.filteredResults = preorder.filteredCount(); return acc; } diff --git a/source/de/anomic/plasma/plasmaSearchPreOrder.java b/source/de/anomic/plasma/plasmaSearchPreOrder.java index 81f425eee..7e5323216 100644 --- a/source/de/anomic/plasma/plasmaSearchPreOrder.java +++ b/source/de/anomic/plasma/plasmaSearchPreOrder.java @@ -65,6 +65,7 @@ public final class plasmaSearchPreOrder { private TreeMap pageAcc; // key = order hash; value = plasmaLURL.entry private plasmaSearchQuery query; private plasmaSearchRankingProfile ranking; + private int filteredCount; public plasmaSearchPreOrder() { this.entryMin = null; @@ -109,6 +110,11 @@ public final class plasmaSearchPreOrder { } pageAcc.put(serverCodings.encodeHex(Long.MAX_VALUE - this.ranking.preRanking(iEntry.generateNormalized(this.entryMin, this.entryMax), query.words("")), 16) + iEntry.urlHash(), iEntry); } + this.filteredCount = pageAcc.size(); + } + + public int filteredCount() { + return this.filteredCount; } public void remove(boolean rootDomExt, boolean doubleDom) { diff --git a/source/de/anomic/plasma/plasmaSearchResult.java b/source/de/anomic/plasma/plasmaSearchResult.java index e2ee0e20f..5b28b4bc8 100644 --- a/source/de/anomic/plasma/plasmaSearchResult.java +++ b/source/de/anomic/plasma/plasmaSearchResult.java @@ -67,6 +67,7 @@ public final class plasmaSearchResult { private plasmaSearchRankingProfile ranking; public int globalContributions; public int localContributions; + public int filteredResults; public plasmaSearchResult(plasmaSearchQuery query, plasmaSearchRankingProfile ranking) { this.pageAcc = new TreeMap(); @@ -76,6 +77,7 @@ public final class plasmaSearchResult { this.ranking = ranking; this.globalContributions = 0; this.localContributions = 0; + this.filteredResults = 0; } public plasmaSearchResult cloneSmart() { diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 0c398abc2..85c1f5590 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -2079,13 +2079,17 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser // result is a List of urlEntry elements: prepare answer if (acc == null) { - prop.put("type_totalcount", "0"); - prop.put("type_orderedcount", "0"); - prop.put("type_linkcount", "0"); + prop.put("num-results_totalcount", 0); + prop.put("num-results_filteredcount", 0); + prop.put("num-results_orderedcount", 0); + prop.put("num-results_linkcount", 0); + prop.put("references", 0); + prop.put("type_results", 0); } else { - prop.put("type_totalcount", acc.globalContributions + acc.localContributions); - prop.put("type_orderedcount", Integer.toString(acc.sizeOrdered())); - prop.put("type_globalresults", acc.globalContributions); + prop.put("num-results_totalcount", acc.globalContributions + acc.localContributions); + prop.put("num-results_filteredcount", acc.filteredResults); + prop.put("num-results_orderedcount", Integer.toString(acc.sizeOrdered())); + prop.put("num-results_globalresults", acc.globalContributions); int i = 0; int p; indexURLEntry urlentry; @@ -2199,16 +2203,17 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser for (int ii = 0; ii < ws.length; ii++) System.out.print(ws[ii] + ", "); System.out.println(" all words = " + ref.getElementCount() + ", total count = " + ref.getTotalCount()); */ - prop.put("type_references", ws); - prop.put("type_linkcount", Integer.toString(i)); + prop.put("references", ws); + prop.put("num-results_linkcount", Integer.toString(i)); prop.put("type_results", Integer.toString(i)); } // log log.logInfo("EXIT WORD SEARCH: " + query.queryWords + " - " + - prop.get("type_totalcount", "0") + " links found, " + - prop.get("type_orderedcount", "0") + " links ordered, " + - prop.get("type_linkcount", "?") + " links selected, " + + prop.get("num-results_totalcount", "0") + " links found, " + + prop.get("num-results_filteredcount", "0") + " links filtered, " + + prop.get("num-results_orderedcount", "0") + " links ordered, " + + prop.get("num-results_linkcount", "?") + " links selected, " + ((System.currentTimeMillis() - timestamp) / 1000) + " seconds"); return prop; } catch (IOException e) {