diff --git a/htroot/yacysearchtrailer.html b/htroot/yacysearchtrailer.html index c3a9cbd55..40d26ca96 100644 --- a/htroot/yacysearchtrailer.html +++ b/htroot/yacysearchtrailer.html @@ -143,60 +143,78 @@ show search results for "#[query]#" on map #(/nav-dates)# + #(nav-domains)#:: + #(/nav-domains)# #(nav-filetypes)#:: + #(/nav-filetypes)# #(nav-languages)#:: + #(/nav-languages)# #(nav-namespace)#:: + #(/nav-namespace)# #(nav-authors)#:: + #(/nav-authors)# #(nav-collections)#:: + #(/nav-collections)# #{nav-vocabulary}# + #{/nav-vocabulary}# #(nav-about)#:: diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java index b46caeb2e..ead131365 100644 --- a/htroot/yacysearchtrailer.java +++ b/htroot/yacysearchtrailer.java @@ -124,6 +124,7 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-namespace_element_" + i + "_name", name); prop.put(fileType, "nav-namespace_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-namespace_element_" + i + "_id", "namespace_" + i); prop.put("nav-namespace_element_" + i + "_count", count); prop.put("nav-namespace_element_" + i + "_nl", 1); i++; @@ -134,7 +135,7 @@ public class yacysearchtrailer { if (pos == 1 && neg == 0) prop.put("nav-namespace", 0); // this navigation is not useful } - // host navigators + // domain navigators final ScoreMap hostNavigator = theSearch.hostNavigator; if (hostNavigator == null || hostNavigator.isEmpty()) { prop.put("nav-domains", 0); @@ -160,11 +161,13 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-domains_element_" + i + "_name", name); prop.put(fileType, "nav-domains_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-domains_element_" + i + "_id", "domains_" + i); prop.put("nav-domains_element_" + i + "_count", count); prop.put("nav-domains_element_" + i + "_nl", 1); i++; } prop.put("nav-domains_element", i); + prop.put("nav-domains_count", i); i--; prop.put("nav-domains_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-domains", 0); // this navigation is not useful @@ -197,11 +200,13 @@ public class yacysearchtrailer { String longname = ISO639.country(name); prop.put(fileType, "nav-languages_element_" + i + "_name", longname == null ? name : longname); prop.put(fileType, "nav-languages_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-languages_element_" + i + "_id", "languages_" + i); prop.put("nav-languages_element_" + i + "_count", count); prop.put("nav-languages_element_" + i + "_nl", 1); i++; } prop.put("nav-languages_element", i); + prop.put("nav-languages_count", i); i--; prop.put("nav-languages_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-languages", 0); // this navigation is not useful @@ -232,11 +237,13 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-authors_element_" + i + "_name", name); prop.put(fileType, "nav-authors_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-authors_element_" + i + "_id", "authors_" + i); prop.put("nav-authors_element_" + i + "_count", count); prop.put("nav-authors_element_" + i + "_nl", 1); i++; } prop.put("nav-authors_element", i); + prop.put("nav-authors_count", i); i--; prop.put("nav-authors_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) { @@ -269,11 +276,13 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-collections_element_" + i + "_name", name); prop.put(fileType, "nav-collections_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-collections_element_" + i + "_id", "collections_" + i); prop.put("nav-collections_element_" + i + "_count", count); prop.put("nav-collections_element_" + i + "_nl", 1); i++; } prop.put("nav-collections_element", i); + prop.put("nav-collections_count", i); i--; prop.put("nav-collections_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-collections", 0); // this navigation is not useful @@ -318,6 +327,7 @@ public class yacysearchtrailer { i++; } prop.put("nav-topics_element", i); + prop.put("nav-topics_count", i); i--; prop.put("nav-topics_element_" + i + "_nl", 0); } @@ -366,6 +376,7 @@ public class yacysearchtrailer { if (oldProtocolModifier != null && oldProtocolModifier.length() > 0) theSearch.query.modifier.add(oldProtocolModifier.startsWith("/") ? oldProtocolModifier : "/" + oldProtocolModifier); theSearch.query.getQueryGoal().query_original = oldQuery; prop.put("nav-protocols_element", i); + prop.put("nav-protocols_count", i); i--; prop.put("nav-protocols_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-protocols", 0); // this navigation is not useful @@ -418,6 +429,7 @@ public class yacysearchtrailer { i++; } prop.put("nav-dates_element", i); + prop.put("nav-dates_count", i); i--; prop.put("nav-dates_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-dates", 0); // this navigation is not useful @@ -450,11 +462,13 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-filetypes_element_" + i + "_name", name); prop.put(fileType, "nav-filetypes_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-filetypes_element_" + i + "_id", "filetypes_" + i); prop.put("nav-filetypes_element_" + i + "_count", count); prop.put("nav-filetypes_element_" + i + "_nl", 1); i++; } prop.put("nav-filetypes_element", i); + prop.put("nav-filetypes_count", i); i--; prop.put("nav-filetypes_element_" + i + "_nl", 0); if (pos == 1 && neg == 0) prop.put("nav-filetypes", 0); // this navigation is not useful @@ -488,11 +502,13 @@ public class yacysearchtrailer { } prop.put(fileType, "nav-vocabulary_" + navvoccount + "_element_" + i + "_name", name); prop.put(fileType, "nav-vocabulary_" + navvoccount + "_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, nav, false).toString()); + prop.put(fileType, "nav-vocabulary_" + navvoccount + "_element_" + i + "_id", "vocabulary_" + navname + "_" + i); prop.put("nav-vocabulary_" + navvoccount + "_element_" + i + "_count", count); prop.put("nav-vocabulary_" + navvoccount + "_element_" + i + "_nl", 1); i++; } prop.put("nav-vocabulary_" + navvoccount + "_element", i); + prop.put("nav-vocabulary_" + navvoccount + "_count", i); i--; prop.put("nav-vocabulary_" + navvoccount + "_element_" + i + "_nl", 0); navvoccount++; diff --git a/source/net/yacy/http/servlets/GSAsearchServlet.java b/source/net/yacy/http/servlets/GSAsearchServlet.java index 004e71d3a..0910803fe 100644 --- a/source/net/yacy/http/servlets/GSAsearchServlet.java +++ b/source/net/yacy/http/servlets/GSAsearchServlet.java @@ -130,7 +130,7 @@ public class GSAsearchServlet extends HttpServlet { // get a solr query string QueryGoal qg = new QueryGoal(originalQuery); - StringBuilder solrQ = qg.collectionTextQueryString(sb.index.fulltext().getDefaultConfiguration(), 0, false); + StringBuilder solrQ = qg.collectionTextQueryString(false); post.put("defType", "edismax"); post.put(CommonParams.Q, solrQ.toString()); post.put(CommonParams.ROWS, post.remove("num")); diff --git a/source/net/yacy/http/servlets/SolrSelectServlet.java b/source/net/yacy/http/servlets/SolrSelectServlet.java index aedcf4989..2f129f26e 100644 --- a/source/net/yacy/http/servlets/SolrSelectServlet.java +++ b/source/net/yacy/http/servlets/SolrSelectServlet.java @@ -141,7 +141,7 @@ public class SolrSelectServlet extends HttpServlet { querystring = modifier.parse(querystring); modifier.apply(mmsp); QueryGoal qg = new QueryGoal(querystring); - StringBuilder solrQ = qg.collectionTextQueryString(sb.index.fulltext().getDefaultConfiguration(), profileNr, false); + StringBuilder solrQ = qg.collectionTextQueryString(false); mmsp.getMap().put(CommonParams.Q, new String[]{solrQ.toString()}); // sru patch } String q = mmsp.get(CommonParams.Q, ""); diff --git a/source/net/yacy/search/query/QueryGoal.java b/source/net/yacy/search/query/QueryGoal.java index 4621f5556..2c286d8a3 100644 --- a/source/net/yacy/search/query/QueryGoal.java +++ b/source/net/yacy/search/query/QueryGoal.java @@ -41,7 +41,6 @@ import net.yacy.document.parser.html.CharacterCoding; import net.yacy.kelondro.data.word.Word; import net.yacy.kelondro.util.SetTools; import net.yacy.search.index.Segment; -import net.yacy.search.schema.CollectionConfiguration; import net.yacy.search.schema.CollectionSchema; public class QueryGoal { @@ -319,7 +318,7 @@ public class QueryGoal { for (final byte[] b: blues) this.include_hashes.remove(b); } - public StringBuilder collectionTextQueryString(CollectionConfiguration configuration, int rankingProfile, boolean noimages) { + public StringBuilder collectionTextQueryString(boolean noimages) { final StringBuilder q = new StringBuilder(80); // add filter to prevent that results come from failed urls diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java index 719376a72..15ad0be68 100644 --- a/source/net/yacy/search/query/QueryParams.java +++ b/source/net/yacy/search/query/QueryParams.java @@ -75,8 +75,8 @@ import org.apache.solr.schema.TrieDateField; public final class QueryParams { - public static int FACETS_STANDARD_MAXCOUNT = 30; - public static int FACETS_DATE_MAXCOUNT = 730; + public static int FACETS_STANDARD_MAXCOUNT = 10000; + public static int FACETS_DATE_MAXCOUNT = 640; public enum Searchdom { LOCAL, CLUSTER, GLOBAL; @@ -371,7 +371,7 @@ public final class QueryParams { // construct query final SolrQuery params = getBasicParams(getFacets); int rankingProfile = this.ranking.coeff_date == RankingProfile.COEFF_MAX ? 1 : (this.modifier.sitehash != null || this.modifier.sitehost != null) ? 2 : 0; - params.setQuery(this.queryGoal.collectionTextQueryString(this.indexSegment.fulltext().getDefaultConfiguration(), rankingProfile, excludeintext_image).toString()); + params.setQuery(this.queryGoal.collectionTextQueryString(excludeintext_image).toString()); Ranking actRanking = indexSegment.fulltext().getDefaultConfiguration().getRanking(rankingProfile); // for a by-date ranking select different ranking profile String fq = actRanking.getFilterQuery();