shortened new search configs

shorter names are more in line with what we already use, makes less
layout problems in the documentation and is easier to type when telling
people about it.
This commit is contained in:
Andreas Gohr 2018-04-11 14:39:04 +02:00
parent 37c80e0e93
commit 13ce475d48
4 changed files with 16 additions and 16 deletions

View File

@ -156,8 +156,8 @@ $conf['broken_iua'] = 0; //Platform with broken ignore_user_abor
$conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard)
$conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generation
$conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate.
$conf['search_limit_to_first_ns'] = 0; //Option to limit the search to the current X namespaces
$conf['search_default_fragment_behaviour'] = 'exact'; // Option to specify the default fragment search behavior
$conf['search_nslimit'] = 0; //limit the search to the current X namespaces
$conf['search_fragment'] = 'exact'; //specify the default fragment search behavior
/* Network Settings */
$conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups

View File

@ -72,7 +72,7 @@ class Search extends AbstractAction {
}
/**
* Adjust the global query accordingly to the config search_limit_to_first_ns and search_default_fragment_behaviour
* Adjust the global query accordingly to the config search_nslimit and search_fragment
*
* This will only do something if the search didn't originate from the form on the searchpage itself
*/
@ -88,16 +88,16 @@ class Search extends AbstractAction {
$parsedQuery = ft_queryParser($Indexer, $QUERY);
if (empty($parsedQuery['ns']) && empty($parsedQuery['notns'])) {
if ($conf['search_limit_to_first_ns'] > 0) {
if ($conf['search_nslimit'] > 0) {
if (getNS($ID) !== false) {
$nsParts = explode(':', getNS($ID));
$ns = implode(':', array_slice($nsParts, 0, $conf['search_limit_to_first_ns']));
$ns = implode(':', array_slice($nsParts, 0, $conf['search_nslimit']));
$QUERY .= " @$ns";
}
}
}
if ($conf['search_default_fragment_behaviour'] !== 'exact') {
if ($conf['search_fragment'] !== 'exact') {
if (empty(array_diff($parsedQuery['words'], $parsedQuery['and']))) {
if (strpos($QUERY, '*') === false) {
$queryParts = explode(' ', $QUERY);
@ -117,10 +117,10 @@ class Search extends AbstractAction {
global $conf;
if ($conf['search_default_fragment_behaviour'] === 'starts_with') {
if ($conf['search_fragment'] === 'starts_with') {
return $part . '*';
}
if ($conf['search_default_fragment_behaviour'] === 'ends_with') {
if ($conf['search_fragment'] === 'ends_with') {
return '*' . $part;
}

View File

@ -178,12 +178,12 @@ $lang['xsendfile'] = 'Use the X-Sendfile header to let the webserver deliver s
$lang['renderer_xhtml'] = 'Renderer to use for main (xhtml) wiki output';
$lang['renderer__core'] = '%s (dokuwiki core)';
$lang['renderer__plugin'] = '%s (plugin)';
$lang['search_limit_to_first_ns'] = 'Limit the search to the current X namespaces. When a search is executed from a page within a deeper namespace, the first X namespaces will be added as filter';
$lang['search_default_fragment_behaviour'] = 'Specify the default fragment search behavior';
$lang['search_default_fragment_behaviour_o_exact'] = 'exact';
$lang['search_default_fragment_behaviour_o_starts_with'] = 'starts with';
$lang['search_default_fragment_behaviour_o_ends_with'] = 'ends with';
$lang['search_default_fragment_behaviour_o_contains'] = 'contains';
$lang['search_nslimit'] = 'Limit the search to the current X namespaces. When a search is executed from a page within a deeper namespace, the first X namespaces will be added as filter';
$lang['search_fragment'] = 'Specify the default fragment search behavior';
$lang['search_fragment_o_exact'] = 'exact';
$lang['search_fragment_o_starts_with'] = 'starts with';
$lang['search_fragment_o_ends_with'] = 'ends with';
$lang['search_fragment_o_contains'] = 'contains';
/* Network Options */
$lang['dnslookups'] = 'DokuWiki will lookup hostnames for remote IP addresses of users editing pages. If you have a slow or non working DNS server or don\'t want this feature, disable this option';

View File

@ -219,8 +219,8 @@ $meta['broken_iua'] = array('onoff');
$meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
$meta['readdircache'] = array('numeric');
$meta['search_limit_to_first_ns'] = array('numeric', '_min' => 0);
$meta['search_default_fragment_behaviour'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
$meta['search_nslimit'] = array('numeric', '_min' => 0);
$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
$meta['_network'] = array('fieldset');
$meta['dnslookups'] = array('onoff');