From d2151857f1401e507c4e9b2997e93af71866d496 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 15 Jun 2014 12:11:23 +0200 Subject: [PATCH] Added collection navigation: The collection field (can be filled i.e. in Crawl Start) can be used to add categories to YaCy index entries. The usage of that field was restricted to solr searches and post argument filters as implemented in commit f7571386a3367432648f7cbd6e4744556ff445a7. This commit extends collections to a full navigation option in the standard YaCy search interface. The field is not active by default but can be activated easily in the /ConfigSearchPage_p.html servlet (just check the 'Collection' facet field). Collections can now be used for (at least) two purposes: - to provide search tenants (through post argument collection) - to provide self-made category navigation Search requests may now have (independently from switched on or off collection facet) a "collection:" modifier attached; firthermore collection names may use disjunctions using the '|' pipe symbol. For example, this is a valid search request: www collection:user|proxy --- defaults/yacy.init | 1 + htroot/ConfigPortal.java | 1 + htroot/ConfigSearchPage_p.html | 8 ++- htroot/ConfigSearchPage_p.java | 2 + htroot/yacy/search.java | 1 + htroot/yacysearch.java | 2 +- htroot/yacysearchtrailer.html | 15 +++++ htroot/yacysearchtrailer.java | 41 ++++++++++++ htroot/yacysearchtrailer.json | 15 ++++- htroot/yacysearchtrailer.xml | 7 +++ .../OpensearchResponseWriter.java | 7 +++ .../responsewriter/YJsonResponseWriter.java | 11 ++++ .../yacy/http/servlets/SolrSelectServlet.java | 2 +- .../net/yacy/search/query/QueryModifier.java | 63 ++++++++++++------- source/net/yacy/search/query/QueryParams.java | 12 ++-- source/net/yacy/search/query/SearchEvent.java | 7 +++ 16 files changed, 163 insertions(+), 32 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 5bbe3ecff..033a33ce1 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -825,6 +825,7 @@ search.result.show.tags = false # can be temporary different if search string is given with differen navigation values # assigning no value(s) means that no navigation is shown search.navigation=location,hosts,authors,namespace,topics,filetype,protocol,language +#search.navigation=location,hosts,authors,namespace,topics,filetype,protocol,language,collections # search result verification and snippet fetch caching rules # each search result can be verified byloading the link from the web diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java index f0dd5888e..61a335d30 100644 --- a/htroot/ConfigPortal.java +++ b/htroot/ConfigPortal.java @@ -170,6 +170,7 @@ public class ConfigPortal { prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0); prop.put("search.navigation.authors", sb.getConfig("search.navigation", "").indexOf("authors",0) >= 0 ? 1 : 0); + prop.put("search.navigation.collections", sb.getConfig("search.navigation", "").indexOf("collections",0) >= 0 ? 1 : 0); prop.put("search.navigation.namespace", sb.getConfig("search.navigation", "").indexOf("namespace",0) >= 0 ? 1 : 0); prop.put("search.navigation.topics", sb.getConfig("search.navigation", "").indexOf("topics",0) >= 0 ? 1 : 0); diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html index bbd6990e8..07117f677 100644 --- a/htroot/ConfigSearchPage_p.html +++ b/htroot/ConfigSearchPage_p.html @@ -125,13 +125,19 @@ - + + + + +