use the search configuration to default the cacheStrategy to the value

as given in the search configuration
pull/1/head
Michael Peter Christen 12 years ago
parent 98819ec3d9
commit 4a9182ae16

@ -40,7 +40,6 @@ import java.util.TreeSet;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.analysis.Classification.ContentDomain;
import net.yacy.cora.document.RSSMessage;
@ -61,7 +60,6 @@ import net.yacy.document.LibraryProvider;
import net.yacy.document.Parser;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.logging.Log;
import net.yacy.kelondro.util.Bitfield;
import net.yacy.kelondro.util.Formatter;
@ -116,7 +114,7 @@ public class yacysearch {
// get query
final String originalquerystring = (post == null) ? "" : post.get("query", post.get("search", "")).trim();
String querystring = originalquerystring.replace('+', ' ').trim();
CacheStrategy snippetFetchStrategy = (post == null) ? null : CacheStrategy.parse(post.get("verify", "cacheonly"));
CacheStrategy snippetFetchStrategy = (post == null) ? null : CacheStrategy.parse(post.get("verify", sb.getConfig("search.verify", "")));
if (authenticated && originalquerystring.length() == 0) sb.index.fulltext().commit();
final servletProperties prop = new servletProperties();

@ -66,7 +66,7 @@ public enum CacheStrategy {
}
public static CacheStrategy parse(final String name) {
if (name == null) return null;
if (name == null || name.length() == 0) return null;
if (name.equals("nocache")) return NOCACHE;
if (name.equals("iffresh")) return IFFRESH;
if (name.equals("ifexist")) return IFEXIST;

@ -24,6 +24,7 @@ package net.yacy.search.query;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Map;
import java.util.SortedSet;
import net.yacy.cora.federate.solr.Boost;
@ -229,7 +230,9 @@ public class QueryGoal {
// combine these queries for all relevant fields
wc = 0;
Float boost;
for (YaCySchema field: Boost.GOAL_FIELDS) {
for (Map.Entry<YaCySchema,Float> entry: Boost.RANKING.entrySet()) {
YaCySchema field = entry.getKey();
if (entry.getValue().floatValue() < 0.0f) continue;
if (configuration != null && !configuration.contains(field.getSolrFieldName())) continue;
if (wc > 0) q.append(" OR ");
q.append('(');

Loading…
Cancel
Save