Reduce number of default max. search navigator lines (from 10000)

to 100 + make it configurable
pull/93/head
reger 8 years ago
parent 065bcfba75
commit af39a76bf6

@ -857,6 +857,9 @@ search.result.show.snapshots = false
search.navigation=location,hosts,authors,namespace,topics,filetype,protocol,language
#search.navigation=location,hosts,authors,namespace,topics,filetype,protocol,language,collections,date
# max number of items displayed in search navigators
search.navigation.maxcount=100
# search result verification and snippet fetch caching rules
# each search result can be verified byloading the link from the web
# this can be enhanced using a cache. In some cases it may be appropriate

@ -158,6 +158,8 @@
</div></td>
</tr>
</table>
<label for="search.navigation.maxcount">max. items</label>
<input type="text" id="search.navigation.maxcount" name="search.navigation.maxcount" size="4" value="#[search.navigation.maxcount]#">
</fieldset>
</div>
</td>

@ -37,6 +37,7 @@ import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.WorkTables;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.QueryParams;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@ -93,6 +94,12 @@ public class ConfigSearchPage_p {
if (post.getBoolean("search.navigation.date")) nav += "date,";
if (nav.endsWith(",")) nav = nav.substring(0, nav.length() - 1);
sb.setConfig("search.navigation", nav);
// maxcount default
int navmaxcnt = post.getInt("search.navigation.maxcount", QueryParams.FACETS_STANDARD_MAXCOUNT);
if (navmaxcnt > 5) {
sb.setConfig(SwitchboardConstants.SEARCH_NAVIGATION_MAXCOUNT, navmaxcnt);
if (navmaxcnt != QueryParams.FACETS_STANDARD_MAXCOUNT) QueryParams.FACETS_STANDARD_MAXCOUNT = navmaxcnt;
}
}
if (post.containsKey("searchpage_default")) {
// load defaults from defaults/yacy.init file
@ -174,6 +181,7 @@ public class ConfigSearchPage_p {
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);
prop.put("search.navigation.date", sb.getConfig("search.navigation", "").indexOf("date",0) >= 0 ? 1 : 0);
prop.put("search.navigation.maxcount", sb.getConfigInt(SwitchboardConstants.SEARCH_NAVIGATION_MAXCOUNT, QueryParams.FACETS_STANDARD_MAXCOUNT));
prop.put("about.headline", sb.getConfig("about.headline", "About"));
prop.put("about.body", sb.getConfig("about.body", ""));

@ -200,6 +200,7 @@ import net.yacy.search.index.Fulltext;
import net.yacy.search.index.Segment;
import net.yacy.search.index.Segment.ReferenceReportCache;
import net.yacy.search.query.AccessTracker;
import net.yacy.search.query.QueryParams;
import net.yacy.search.query.SearchEvent;
import net.yacy.search.query.SearchEventCache;
import net.yacy.search.ranking.RankingProfile;
@ -1164,6 +1165,9 @@ public final class Switchboard extends serverSwitch {
this.trail = new LinkedBlockingQueue<String>();
// set configurable ui defaults
QueryParams.FACETS_STANDARD_MAXCOUNT = sb.getConfigInt(SwitchboardConstants.SEARCH_NAVIGATION_MAXCOUNT, QueryParams.FACETS_STANDARD_MAXCOUNT); // max number of navigator/facet lines
this.log.config("Finished Switchboard Initialization");
}

@ -491,6 +491,8 @@ public final class SwitchboardConstants {
public static final String SEARCH_VERIFY = "search.verify";
public static final String SEARCH_VERIFY_DELETE = "search.verify.delete";
public static final String SEARCH_NAVIGATION_MAXCOUNT = "search.navigation.maxcount"; // max lines displayed in standard search navigators/facets
/**
* ranking+evaluation
*/

@ -80,7 +80,7 @@ import org.apache.solr.util.DateFormatUtil;
public final class QueryParams {
public static int FACETS_STANDARD_MAXCOUNT = 10000;
public static int FACETS_STANDARD_MAXCOUNT = 100; // max count of item lines in navigator
public static int FACETS_DATE_MAXCOUNT = 640;
public enum Searchdom {

@ -89,7 +89,7 @@ public class ReferenceContainerTest {
assertNotNull("getReference failed", wc);
// TODO: ReferenceContainer used for rwi results. As it distance doesn't persist after adding ref to container making the distance ranking obsolete -> remove or fix
// TODO: ReferenceContainer used for rwi results. As distance doesn't persist after adding ref to container making the distance ranking obsolete -> remove or fix
System.out.println("-----------------------------------------------------------");
System.out.println("WordReference (word distance) before add to container: " + wentry.distance());
System.out.println("WordReference (word distance) after get from container: " + wc.distance());

Loading…
Cancel
Save