Merge pull request #2 from yacy/master

Merge #2
pull/128/head
Andreas 8 years ago committed by GitHub
commit 1456f57085

@ -20,6 +20,9 @@
<input type="hidden" name="urlmaskfilter" value=".*" />
<input type="hidden" name="prefermaskfilter" value="" />
<input type="hidden" name="nav" value="all" />
#(authorized)#::
<input type="hidden" name="auth" id="auth" value=""/>
#(/authorized)#
</form>
</div>
<script type="text/javascript">

@ -61,6 +61,9 @@
<button id="Enter" name="Enter" class="btn btn-primary" type="submit">Search</button>
</div>
</div>
#(authorized)#::
<input type="hidden" name="auth" id="auth" value=""/>
#(/authorized)#
<input type="hidden" name="verify" value="#[search.verify]#" />
#(searchdomswitches)#::
<div class="yacysearch">

@ -109,6 +109,9 @@ Use the RSS search result format to add static searches to your RSS reader, if y
#(/resortEnabled)#
</div>
</div>
#(authorized)#::
<input type="hidden" name="auth" id="auth" value=""/>
#(/authorized)#
<input type="hidden" name="contentdom" id="contentdom" value="#[contentdom]#" />
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />

@ -106,7 +106,7 @@ public class yacysearch {
boolean authenticated = sb.adminAuthenticated(header) >= 2;
if ( !authenticated ) {
final UserDB.Entry user = sb.userDB.getUser(header);
final UserDB.Entry user = sb.userDB != null ? sb.userDB.getUser(header) : null;
authenticated = (user != null && user.hasRight(UserDB.AccessRight.EXTENDED_SEARCH_RIGHT));
}
final boolean localhostAccess = header.accessFromLocalhost();
@ -198,6 +198,18 @@ public class yacysearch {
return prop;
}
if (post.containsKey("auth") && !authenticated) {
/*
* Access to authentication protected features is explicitely requested here
* but no authentication is provided : ask now for authentication.
* Wihout this, after timeout of HTTP Digest authentication nonce, browsers no more send authentication information
* and as this page is not private, protected features would simply be hidden without asking browser again for authentication.
* (see mantis 766 : http://mantis.tokeek.de/view.php?id=766) *
*/
prop.authenticationRequired();
return prop;
}
// check for JSONP
if ( post.containsKey("callback") ) {
final String jsonp = post.get("callback") + "([";
@ -764,7 +776,7 @@ public class yacysearch {
RequestHeader.FileType.HTML,
0,
theQuery,
suggestion, true).toString());
suggestion, true, authenticated).toString());
prop.put("didYouMean_suggestions_" + meanCount + "_sep", "|");
meanCount++;
} catch (final ConcurrentModificationException e) {
@ -842,8 +854,9 @@ public class yacysearch {
* eventually including fetched results with higher ranks from the Solr and RWI stacks */
prop.put("resortEnabled", !jsResort && global && !stealthmode && theSearch.resortCacheAllowed.availablePermits() > 0 ? 1 : 0);
prop.put("resortEnabled_url",
QueryParams.navurlBase(RequestHeader.FileType.HTML, theQuery, null, true).append("&startRecord=")
.append(startRecord).append("&resortCachedResults=true").toString());
QueryParams.navurlBase(RequestHeader.FileType.HTML, theQuery, null, true, authenticated)
.append("&startRecord=").append(startRecord).append("&resortCachedResults=true")
.toString());
// generate the search result lines; the content will be produced by another servlet
for ( int i = 0; i < theQuery.itemsPerPage(); i++ ) {

@ -25,7 +25,7 @@
</div>
<p class="snippet"><span class="snippetLoaded" id="h#[urlhash]#">#[description]#</span></p>
<p class="url"><a href="#[link]#" id="url#[urlhash]#" target="#[target]#" #(noreferrer)#::rel="noreferrer"#(/noreferrer)#>#[urlname]#</a></p>
#(showKeywords)#::<p class="tags">Tags: #{keywords}#<span class="tag label label-default">#[tagword]#</span> #{/keywords}#</p>#(/showKeywords)#
#(showKeywords)#::<p class="tags">Tags: #{keywords}#<span class="tag label label-default"><a href="#[tagurl]#" style="color: inherit; text-decoration: inherit;">#[tagword]#</a></span> #{/keywords}#</p>#(/showKeywords)#
<p class="urlinfo">
#(showDate)#::#[date]##(/showDate)#
#(showEvent)#::on #[date]##(/showEvent)#
@ -33,7 +33,7 @@
#(showMetadata)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="solr/select?q=id:%22#[urlhash]#%22&defType=edismax&start=0&rows=1&core=collection1&wt=html" target="_blank">Metadata</a>#(/showMetadata)#
#(showParser)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#" target="_blank">Parser</a>#(/showParser)#
#(showCitation)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="api/citation.html?hash=#[urlhash]#&filter=true" target="_blank">Citations</a>#(/showCitation)#
#(showPictures)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="yacysearch.html?contentdom=image&url=#[link]#&query=#[former]#+inurl:#[link]#" target="_blank">Pictures</a>#(/showPictures)#
#(showPictures)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="yacysearch.html?contentdom=image#(authorized)#::&auth#(/authorized)#&url=#[link]#&query=#[former]#+inurl:#[link]#" target="_blank">Pictures</a>#(/showPictures)#
#(showCache)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)#
#(showProxy)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="proxy.html?url=#[link]#" target="_blank">View via proxy</a>#(/showProxy)#
#(showHostBrowser)#::<span role="separator" aria-orientation="vertical">&nbsp;|&nbsp;</span><a href="HostBrowser.html?path=#[link]#"><img src="env/grafics/minitree.png" width="15" height="8" title="Browse index" alt="Browse index"/></a>#(/showHostBrowser)#

@ -53,7 +53,9 @@ import net.yacy.crawler.data.Transactions;
import net.yacy.crawler.data.Transactions.State;
import net.yacy.crawler.retrieval.Response;
import net.yacy.data.URLLicense;
import net.yacy.data.UserDB;
import net.yacy.document.parser.html.IconEntry;
import net.yacy.http.servlets.TemplateMissingParameterException;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.util.Formatter;
import net.yacy.peers.NewsPool;
@ -62,6 +64,7 @@ import net.yacy.peers.graphics.ProfilingGraph;
import net.yacy.search.EventTracker;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.navigator.Navigator;
import net.yacy.search.query.HeuristicResult;
import net.yacy.search.query.QueryParams;
import net.yacy.search.query.SearchEvent;
@ -88,14 +91,35 @@ public class yacysearchitem {
//private static boolean col = true;
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
if (post == null) {
throw new TemplateMissingParameterException("The eventID parameter is required");
}
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
final String eventID = post.get("eventID", "");
final boolean authenticated = sb.verifyAuthentication(header);
final boolean adminAuthenticated = sb.verifyAuthentication(header);
final UserDB.Entry user = sb.userDB != null ? sb.userDB.getUser(header) : null;
final boolean userAuthenticated = (user != null && user.hasRight(UserDB.AccessRight.EXTENDED_SEARCH_RIGHT));
final boolean authenticated = adminAuthenticated || userAuthenticated;
final int item = post.getInt("item", -1);
final RequestHeader.FileType fileType = header.fileType();
if (post.containsKey("auth") && !authenticated) {
/*
* Access to authentication protected features is explicitely requested here
* but no authentication is provided : ask now for authentication.
* Wihout this, after timeout of HTTP Digest authentication nonce, browsers no more send authentication information
* and as this page is not private, protected features would simply be hidden without asking browser again for authentication.
* (see mantis 766 : http://mantis.tokeek.de/view.php?id=766) *
*/
prop.authenticationRequired();
return prop;
}
// default settings for blank item
prop.put("content", "0");
prop.put("rss", "0");
@ -121,7 +145,9 @@ public class yacysearchitem {
prop.put("statistics_localIndexCount", Formatter.number(theSearch.local_rwi_available.get() + theSearch.local_solr_stored.get() - theSearch.local_solr_evicted.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_navurlBase", QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false).toString());
prop.put("statistics_navurlBase",
QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false, authenticated)
.toString());
prop.put("statistics_localQuery", theSearch.query.isLocal() ? "1" : "0");
prop.put("statistics_feedRunning", Boolean.toString(!theSearch.isFeedingFinished()));
final String target_special_pattern = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "");
@ -142,9 +168,9 @@ public class yacysearchitem {
final String resource = theSearch.query.domType.toString();
final String origQ = theSearch.query.getQueryGoal().getQueryString(true);
prop.put("content", 1); // switch on specific content
prop.put("content_authorized", authenticated ? "1" : "0");
prop.put("content_authorized", adminAuthenticated ? "1" : "0");
final String urlhash = ASCII.String(result.hash());
if (authenticated) { // only needed if authorized
if (adminAuthenticated) { // only needed if authorized
addAuthorizedActions(sb, prop, theSearch, resultUrlstring, resource, origQ, urlhash);
}
prop.putHTML("content_title", result.title());
@ -242,10 +268,20 @@ public class yacysearchitem {
if (showEvent) prop.put("content_showEvent_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(events[0]));
if (showKeywords) { // tokenize keywords
StringTokenizer stoc = new StringTokenizer(result.dc_subject()," ");
String rawNavQueryModifier;
Navigator navi = theSearch.navigatorPlugins.get("keywords");
boolean naviAvail = navi != null;
int i = 0;
while (stoc.hasMoreTokens()) {
String word = stoc.nextToken();
prop.putHTML("content_showKeywords_keywords_" + i + "_tagword", word);
if (naviAvail) { // use query modifier if navigator available
rawNavQueryModifier = navi.getQueryModifier(word);
} else { // otherwise just use the keyword as additional query word
rawNavQueryModifier = word;
}
prop.put("content_showKeywords_keywords_" + i + "_tagurl", QueryParams.navurl(fileType, 0,
theSearch.query, rawNavQueryModifier, naviAvail, authenticated).toString());
i++;
}
prop.put("content_showKeywords_keywords", i);
@ -461,10 +497,10 @@ public class yacysearchitem {
/* Bookmark, delete and recommend action links share the same URL prefix */
StringBuilder linkBuilder = new StringBuilder();
String actionLinkPrefix = linkBuilder.append("yacysearch.html?query=").append(origQ.replace(' ', '+'))
final String actionLinkPrefix = linkBuilder.append("yacysearch.html?query=").append(origQ.replace(' ', '+'))
.append("&Enter=Search&count=").append(theSearch.query.itemsPerPage()).append("&offset=")
.append((theSearch.query.neededResults() - theSearch.query.itemsPerPage())).append("&resource=")
.append(resource).append("&time=3").toString();
.append(resource).append("&time=3").append("auth").toString();
linkBuilder.setLength(0);
String encodedURLString;
@ -474,7 +510,7 @@ public class yacysearchitem {
ConcurrentLog.warn("YACY_SEARCH_ITEM", "UTF-8 encoding is not supported!");
encodedURLString = crypt.simpleEncode(resultUrlstring);
}
String bookmarkLink = linkBuilder.append(actionLinkPrefix).append("&bookmarkref=").append(urlhash)
final String bookmarkLink = linkBuilder.append(actionLinkPrefix).append("&bookmarkref=").append(urlhash)
.append("&bookmarkurl=").append(encodedURLString).append("&urlmaskfilter=.*")
.toString();
linkBuilder.setLength(0);

@ -1,5 +1,8 @@
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.UserDB;
import net.yacy.http.servlets.TemplateMissingParameterException;
import net.yacy.kelondro.util.Formatter;
import net.yacy.search.Switchboard;
import net.yacy.search.query.QueryParams;
import net.yacy.search.query.SearchEvent;
import net.yacy.search.query.SearchEventCache;
@ -10,8 +13,17 @@ import net.yacy.server.serverSwitch;
public class yacysearchlatestinfo {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {
if (post == null) {
throw new TemplateMissingParameterException("The eventID parameter is required");
}
final serverObjects prop = new serverObjects();
//Switchboard sb = (Switchboard) env;
Switchboard sb = (Switchboard) env;
final boolean adminAuthenticated = sb.verifyAuthentication(header);
final UserDB.Entry user = sb.userDB != null ? sb.userDB.getUser(header) : null;
final boolean userAuthenticated = (user != null && user.hasRight(UserDB.AccessRight.EXTENDED_SEARCH_RIGHT));
final boolean authenticated = adminAuthenticated || userAuthenticated;
// find search event
final String eventID = post.get("eventID", "");
@ -44,7 +56,7 @@ public class yacysearchlatestinfo {
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("remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true));
prop.putJSON("navurlBase", QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false).toString());
prop.putJSON("navurlBase", QueryParams.navurlBase(RequestHeader.FileType.HTML, theSearch.query, null, false, authenticated).toString());
prop.put("feedRunning", Boolean.toString(!theSearch.isFeedingFinished()));
return prop;

@ -35,8 +35,10 @@ import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.sorting.ScoreMap;
import net.yacy.data.UserDB;
import net.yacy.document.DateDetection;
import net.yacy.document.LibraryProvider;
import net.yacy.http.servlets.TemplateMissingParameterException;
import net.yacy.kelondro.util.ISO639;
import net.yacy.peers.graphics.ProfilingGraph;
import net.yacy.search.EventTracker;
@ -59,17 +61,38 @@ public class yacysearchtrailer {
@SuppressWarnings({ })
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
if (post == null) {
throw new TemplateMissingParameterException("The eventID parameter is required");
}
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
final String eventID = post.get("eventID", "");
final boolean authorized = sb.verifyAuthentication(header);
final boolean adminAuthenticated = sb.verifyAuthentication(header);
final UserDB.Entry user = sb.userDB != null ? sb.userDB.getUser(header) : null;
final boolean userAuthenticated = (user != null && user.hasRight(UserDB.AccessRight.EXTENDED_SEARCH_RIGHT));
final boolean authenticated = adminAuthenticated || userAuthenticated;
if (post.containsKey("auth") && !authenticated) {
/*
* Access to authentication protected features is explicitely requested here
* but no authentication is provided : ask now for authentication.
* Wihout this, after timeout of HTTP Digest authentication nonce, browsers no more send authentication information
* and as this page is not private, protected features would simply be hidden without asking browser again for authentication.
* (see mantis 766 : http://mantis.tokeek.de/view.php?id=766) *
*/
prop.authenticationRequired();
return prop;
}
final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER);
final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true) || clustersearch;
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
boolean global = post == null || (!post.get("resource-switch", post.get("resource", "global")).equals("local") && p2pmode);
boolean stealthmode = p2pmode && !global;
prop.put("resource-select", !authorized ? 0 : stealthmode ? 2 : global ? 1 : 0);
prop.put("resource-select", !adminAuthenticated ? 0 : stealthmode ? 2 : global ? 1 : 0);
// find search event
final SearchEvent theSearch = SearchEventCache.getEvent(eventID);
if (theSearch == null) {
@ -130,7 +153,8 @@ 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, rawNav, false).toString());
prop.put(fileType, "nav-languages_element_" + i + "_url",
QueryParams.navurl(fileType, 0, theSearch.query, rawNav, false, authenticated).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);
@ -172,7 +196,8 @@ public class yacysearchtrailer {
count = entry.getValue();
prop.put(fileType, "nav-topics_element_" + i + "_modifier", name);
prop.put(fileType, "nav-topics_element_" + i + "_name", name);
prop.put(fileType, "nav-topics_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, name, false).toString());
prop.put(fileType, "nav-topics_element_" + i + "_url", QueryParams
.navurl(fileType, 0, theSearch.query, name, false, authenticated).toString());
prop.put("nav-topics_element_" + i + "_count", count);
int fontsize = TOPWORDS_MINSIZE + (TOPWORDS_MAXSIZE - TOPWORDS_MINSIZE) * (count - mincount) / (1 + maxcount - mincount);
fontsize = Math.max(TOPWORDS_MINSIZE, fontsize - (name.length() - 5));
@ -223,7 +248,8 @@ public class yacysearchtrailer {
rawNav = "";
}
prop.put(fileType, "nav-protocols_element_" + i + "_name", name);
String url = QueryParams.navurl(fileType, 0, theSearch.query, rawNav, false).toString();
String url = QueryParams.navurl(fileType, 0, theSearch.query, rawNav, false, authenticated)
.toString();
prop.put("nav-protocols_element_" + i + "_onclick_url", url);
prop.put(fileType, "nav-protocols_element_" + i + "_url", url);
prop.put("nav-protocols_element_" + i + "_count", count);
@ -326,7 +352,8 @@ public class yacysearchtrailer {
rawNav = "";
}
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, rawNav, false).toString());
prop.put(fileType, "nav-vocabulary_" + navvoccount + "_element_" + i + "_url", QueryParams
.navurl(fileType, 0, theSearch.query, rawNav, false, authenticated).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);
@ -385,7 +412,8 @@ public class yacysearchtrailer {
rawNav = "";
}
prop.put(fileType, "navs_" + ni + "_element_" + i + "_name", navi.getElementDisplayName(name));
prop.put(fileType, "navs_" + ni + "_element_" + i + "_url", QueryParams.navurl(fileType, 0, theSearch.query, rawNav, false).toString());
prop.put(fileType, "navs_" + ni + "_element_" + i + "_url", QueryParams
.navurl(fileType, 0, theSearch.query, rawNav, false, authenticated).toString());
prop.put(fileType, "navs_" + ni + "_element_" + i + "_id", naviname + "_" + i);
prop.put("navs_" + ni + "_element_" + i + "_count", count);
prop.put("navs_" + ni + "_element_" + i + "_nl", 1);

@ -840,15 +840,14 @@ Replace the word "MySearch" with your own message==Ersetzen Sie das Wort "Meine
#File: ConfigSearchPage_p.html
#---------------------------
<html lang="en">==<html lang="de">
Search Page<==Suchseite<
>Search Result Page Layout Configuration<==>Konfiguration des Seitenlayouts der Seite für Suchergebnisse<
Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Im Folgenden wird ein generisches Template einer Suchergebnisseite. Markieren Sie die Checkboxen für alle Features die angezeigt werden sollen.
To change colors and styles use the ==Um die Farben und Stile zu ändern, verwenden Sie das
>Appearance<==>Erscheinungsbild<
menu for different skins.== Menü für verschiedene Skins.
Other portal settings can be adjusted in==Andere Einstellungen für das Portal können im
>Generic Search Portal<==>Generisches Suchportal<
menu.==Menü geändert werden.
Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu.==Andere Einstellungen für das Portal können im <a href="ConfigPortal_p.html">Generisches Suchportal</a> Menü geändert werden.
>Page Template<==>Seiten Template<
#>Administration<==>Administration<
>Web Search<==>Websuche<

@ -545,6 +545,60 @@ For explanation please look into defaults/yacy.init==Pour des explications, rega
"Save"=="Sauvegarder"
#-----------------------------
#File: ConfigSearchPage_p.html
#---------------------------
<html lang="en">==<html lang="fr">
Search Page<==Page de recherche<
>Search Result Page Layout Configuration<==>Agencement de la page de résultats de recherche<
Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Ci-dessous se trouve un modèle générique de page de résultats de recherche. Cocher les cases des éléments que vous souhaitez voir s'afficher.
To change colors and styles use the ==Pour modifier les couleurs et le style, utilisez le menu
>Appearance<==>Apparence graphique<
menu for different skins.== pour avoir accès à différentes présélections de styles.
Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu.==Les autres éléments de configuration du portail peuvent être définis dans le menu <a href="ConfigPortal_p.html">Generic Search Portal</a>.
>Page Template<==>Modèle de page<
>Text<==>Texte<
>Video<==>Vidéo<
>more options<==>plus d'options<
>Topics<==>Sujets<
>Cloud<==>Nuage<
>Protocol<==>Protocole<
>Filetype<==>Type de fichier<
>Wiki Name Space<==>Espace de nommage Wiki<
>Language<==>Langue<
>Author<==>Auteur<
>Vocabulary<==>Ontologie<
>Provider<==>Hôte<
>Title of Result<==>Titre du résultat<
Description and text snippet of the search result==Description et extrait de texte du résultat de recherche
"Date"=="Date"
42 kbyte<==42 ko<
"Size"=="Taille"
>Metadata<==>Méta-données<
>Parser<==>Analyseur d'URL<
>Citation<==>Citations<
>Pictures<==>Images<
"Browse index"=="Parcourir l'index"
For this option URL proxy must be enabled.==Pour cette option le proxy doit être activé.
max. items==nb. max. d'éléments
"Save Settings"=="Enregistrer"
"Set Default Values"=="Valeurs par défaut"
"Top navigation bar"=="Barre de navigation d'en-tête"
>Location<==>Lieu<
show search results on map==Montrer les résultats sur la carte
Date Navigation==Statistiques par dates
Maximum range (in days)==Période maximale (en jours)
Maximum days number in the histogram. Beware that a large value may trigger high CPU loads both on the server and on the browser with large result sets.==Nombre maximum de jours de l'histogramme. Veuillez noter qu'une valeur élevée peut déclencher des charges CPU importantes tant sur le serveur que sur le navigateur lorsqu'il y a un grand nombre de résultats.
keyword subject keyword2 keyword3==mot-clé sujet mot-clé2 mot-clé3
View via Proxy==Ouvrir via le proxy
>Snapshots<==>Captures<
"Raw ranking score value"=="Score de classement brut"
Ranking: 1.12195955E9==Score: 1.12195955E9
"Delete navigator"=="Supprimer le groupe"
Add Navigators==Ajout de groupes de navigation
"Add navigator"=="Ajouter le groupe"
>append==>Ajouter
#-----------------------------
#File: ConfigSkins_p.html
#---------------------------
Skin Selection==Choix de th&egrave;me
@ -2637,8 +2691,9 @@ Parser Configuration==Configuration de l'analyseur syntaxique
#File: env/templates/submenuDesign.template
#-----------------------------
>Appearance==>Apparence
>Language==>Langue
>Appearance<==>Apparence graphique<
>Language<==>Langue<
Search Page Layout==Agencement de la page de résultats
#-----------------------------
#File: env/templates/submenuIndexControl.template

@ -615,6 +615,7 @@ This would look like:==これは次の様に見えます:
#File: ConfigSearchPage_p.html
#---------------------------
<html lang="en">==<html lang="ja">
Search Page<==検索ページ<
>Search Result Page Layout Configuration<==>検索結果のページのレイアウトの構成<
>Appearance<==>外観<

@ -2043,10 +2043,7 @@
<source> menu for different skins.</source>
</trans-unit>
<trans-unit id="40d7aca3" xml:space="preserve" approved="no" translate="yes">
<source>Other portal settings can be adjusted in</source>
</trans-unit>
<trans-unit id="89a2021f" xml:space="preserve" approved="no" translate="yes">
<source>&gt;Generic Search Portal&lt;</source>
<source>Other portal settings can be adjusted in &lt;a href="ConfigPortal_p.html"&gt;Generic Search Portal&lt;/a&gt; menu.</source>
</trans-unit>
<trans-unit id="58b4a6f" xml:space="preserve" approved="no" translate="yes">
<source>&gt;Page Template&lt;</source>
@ -2126,9 +2123,21 @@
<trans-unit id="479c86d8" xml:space="preserve" approved="no" translate="yes">
<source>&gt;Cache&lt;</source>
</trans-unit>
<trans-unit id="b3979711" xml:space="preserve" approved="no" translate="yes">
<source>&lt;html lang="en"&gt;</source>
</trans-unit>
<trans-unit id="3df0db32" xml:space="preserve" approved="no" translate="yes">
<source>"Date"</source>
</trans-unit>
<trans-unit id="3ec7f53f" xml:space="preserve" approved="no" translate="yes">
<source>"Size"</source>
</trans-unit>
<trans-unit id="f46b1ae4" xml:space="preserve" approved="no" translate="yes">
<source>"Browse index"</source>
</trans-unit>
<trans-unit id="37b12af6" xml:space="preserve" approved="no" translate="yes">
<source>For this option URL proxy must be enabled.</source>
</trans-unit>
</trans-unit>
<trans-unit id="a0b7e36a" xml:space="preserve" approved="no" translate="yes">
<source>max. items</source>
</trans-unit>
@ -2138,8 +2147,50 @@
<trans-unit id="637bace1" xml:space="preserve" approved="no" translate="yes">
<source>"Set Default Values"</source>
</trans-unit>
<trans-unit id="62f96af" xml:space="preserve" approved="no" translate="yes">
<source>menu.</source>
<trans-unit id="30768cae" xml:space="preserve" approved="no" translate="yes">
<source>"Top navigation bar"</source>
</trans-unit>
<trans-unit id="59dfdc89" xml:space="preserve" approved="no" translate="yes">
<source>&gt;Location&lt;</source>
</trans-unit>
<trans-unit id="2565239a" xml:space="preserve" approved="no" translate="yes">
<source>show search results on map</source>
</trans-unit>
<trans-unit id="12350dc6" xml:space="preserve" approved="no" translate="yes">
<source>Date Navigation</source>
</trans-unit>
<trans-unit id="57a422dc" xml:space="preserve" approved="no" translate="yes">
<source>Maximum range (in days)</source>
</trans-unit>
<trans-unit id="36b6c646" xml:space="preserve" approved="no" translate="yes">
<source>Maximum days number in the histogram. Beware that a large value may trigger high CPU loads both on the server and on the browser with large result sets.</source>
</trans-unit>
<trans-unit id="cfe1ccd6" xml:space="preserve" approved="no" translate="yes">
<source>keyword subject keyword2 keyword3</source>
</trans-unit>
<trans-unit id="b62dd421" xml:space="preserve" approved="no" translate="yes">
<source>View via Proxy</source>
</trans-unit>
<trans-unit id="43d1a9cb" xml:space="preserve" approved="no" translate="yes">
<source>&gt;Snapshots&lt;</source>
</trans-unit>
<trans-unit id="f5192903" xml:space="preserve" approved="no" translate="yes">
<source>"Raw ranking score value"</source>
</trans-unit>
<trans-unit id="7450e2ba" xml:space="preserve" approved="no" translate="yes">
<source>Ranking: 1.12195955E9</source>
</trans-unit>
<trans-unit id="b42e923e" xml:space="preserve" approved="no" translate="yes">
<source>"Delete navigator"</source>
</trans-unit>
<trans-unit id="851aa1b" xml:space="preserve" approved="no" translate="yes">
<source>Add Navigators</source>
</trans-unit>
<trans-unit id="80a3ea4c" xml:space="preserve" approved="no" translate="yes">
<source>"Add navigator"</source>
</trans-unit>
<trans-unit id="7ba728d8" xml:space="preserve" approved="no" translate="yes">
<source>&gt;append</source>
</trans-unit>
<trans-unit id="5ebd116f" xml:space="preserve" approved="no" translate="yes">
<source>http://url-of-the-search-result.net</source>

@ -938,14 +938,14 @@ Replace the word "MySearch" with your own message==Заменить слово "
#File: ConfigSearchPage_p.html
#---------------------------
<html lang="en">==<html lang="ru">
Search Page<==Страница поиска<
>Search Result Page Layout Configuration<==>Конфигурация макета страницы результатов поиска<
Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed.==Ниже приведён общий макет страницы результатов поиска. Отметьте компоненты, которые должны быть отображены.
To change colors and styles use the ==Изменить цвета, стили и скины вы можете
>Appearance<==>здесь<
menu for different skins.==.
Other portal settings can be adjusted in==Другие настройки портала могут быть изменены на
>Generic Search Portal<==>странице интеграции поиска<
Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu.==Другие настройки портала могут быть изменены на Меню <a href="ConfigPortal_p.html">странице интеграции поиска</a>.
>Page Template<==>Макет страницы<
>Administration<==>Администрирование<
>Web Search<==>Вэб-поиск<

@ -221,6 +221,7 @@ public class QueryModifier {
/**
* Parse query string for filetype (file extension) parameter
* and adjust parameter to lowercase
* @param querystring
* @param filetypePrefix "filetype:"
* @return querystring with filetype parameter removed
@ -230,8 +231,9 @@ public class QueryModifier {
if ( ftp >= 0 ) {
int ftb = querystring.indexOf(' ', ftp);
if ( ftb < 0 ) ftb = querystring.length();
filetype = querystring.substring(ftp + filetypePrefix.length(), ftb);
querystring = querystring.replace(filetypePrefix + filetype, "");
String tmpqueryparameter = querystring.substring(ftp + filetypePrefix.length(), ftb);
querystring = querystring.replace(filetypePrefix + tmpqueryparameter, ""); // replace prefix:Text as found
filetype = tmpqueryparameter.toLowerCase(); // file extension are always compared lowercase, can be converted here for further processing
while ( !filetype.isEmpty() && filetype.charAt(0) == '.' ) {
filetype = filetype.substring(1);
}

@ -44,6 +44,13 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.apache.lucene.util.automaton.Automata;
import org.apache.lucene.util.automaton.Automaton;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.SortClause;
import org.apache.solr.common.params.DisMaxParams;
import org.apache.solr.common.params.FacetParams;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.analysis.Classification.ContentDomain;
import net.yacy.cora.document.encoding.ASCII;
@ -71,13 +78,6 @@ import net.yacy.search.ranking.RankingProfile;
import net.yacy.search.schema.CollectionConfiguration;
import net.yacy.search.schema.CollectionSchema;
import org.apache.lucene.util.automaton.Automata;
import org.apache.lucene.util.automaton.Automaton;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.SortClause;
import org.apache.solr.common.params.DisMaxParams;
import org.apache.solr.common.params.FacetParams;
public final class QueryParams {
/** The default max count of item lines in navigator */
@ -734,12 +734,18 @@ public final class QueryParams {
}
/**
* make a query anchor tag
* @return the anchor url builder
*/
public static StringBuilder navurl(final RequestHeader.FileType ext, final int page, final QueryParams theQuery, final String newQueryString, boolean newModifierReplacesOld) {
final StringBuilder sb = navurlBase(ext, theQuery, newQueryString, newModifierReplacesOld);
* make a query anchor tag
*
* @param authenticatedFeatures
* when true, access to authentication protected search features is
* wanted
* @return the anchor url builder
*/
public static StringBuilder navurl(final RequestHeader.FileType ext, final int page, final QueryParams theQuery,
final String newQueryString, boolean newModifierReplacesOld, final boolean authenticatedFeatures) {
final StringBuilder sb = navurlBase(ext, theQuery, newQueryString, newModifierReplacesOld,
authenticatedFeatures);
sb.append("&startRecord=");
sb.append(page * theQuery.itemsPerPage());
@ -748,17 +754,24 @@ public final class QueryParams {
}
/**
* construct navigator url
*
* @param ext extension of servlet (e.g. html, rss)
* @param theQuery search query
* @param newModifier optional new modifier.
* - if null existing modifier of theQuery is appended
* - if not null this new modifier is appended in addition to existing modifier
* - if isEmpty overwrites (clears) existing modifier
* @return url to new search result page
*/
public static StringBuilder navurlBase(final RequestHeader.FileType ext, final QueryParams theQuery, final String newModifier, boolean newModifierReplacesOld) {
* construct navigator url
*
* @param ext
* extension of servlet (e.g. html, rss)
* @param theQuery
* search query
* @param newModifier
* optional new modifier. - if null existing modifier of theQuery is
* appended - if not null this new modifier is appended in addition
* to existing modifier - if isEmpty overwrites (clears) existing
* modifier
* @param authenticatedFeatures
* when true, access to authentication protected search features is
* wanted
* @return url to new search result page
*/
public static StringBuilder navurlBase(final RequestHeader.FileType ext, final QueryParams theQuery,
final String newModifier, final boolean newModifierReplacesOld, final boolean authenticatedFeatures) {
StringBuilder sb = new StringBuilder(120);
sb.append("yacysearch.");
@ -811,6 +824,10 @@ public final class QueryParams {
sb.append("&former=");
sb.append(theQuery.getQueryGoal().getQueryString(true));
if(authenticatedFeatures) {
sb.append("&auth");
}
return sb;
}

Loading…
Cancel
Save