MDL-53226 search_simpledb: Adding clumsy search
[moodle.git] / search / engine / solr / settings.php
CommitLineData
95c6aeaf
DM
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Solr search engine settings.
19 *
20 * @package search_solr
21 * @copyright 2015 Daniel Neis
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
25defined('MOODLE_INTERNAL') || die();
26
27if ($ADMIN->fulltree) {
28
29 if (!during_initial_install()) {
30 if (!function_exists('solr_get_version')) {
31 $settings->add(new admin_setting_heading('search_solr_settings', '', get_string('extensionerror', 'search_solr')));
32
33 } else {
cd894f84
EM
34 $settings->add(new admin_setting_heading('search_solr_connection',
35 new lang_string('connectionsettings', 'search_solr'), ''));
19773d75
DM
36 $settings->add(new admin_setting_configtext('search_solr/server_hostname', new lang_string('solrserverhostname', 'search_solr'), new lang_string('solrserverhostname_desc', 'search_solr'), '127.0.0.1', PARAM_HOST));
37 $settings->add(new admin_setting_configtext('search_solr/indexname', new lang_string('solrindexname', 'search_solr'), '', '', PARAM_ALPHANUMEXT));
95c6aeaf
DM
38 $settings->add(new admin_setting_configcheckbox('search_solr/secure', new lang_string('solrsecuremode', 'search_solr'), '', 0, 1, 0));
39
40 $secure = get_config('search_solr', 'secure');
41 $defaultport = !empty($secure) ? 8443 : 8983;
42 $settings->add(new admin_setting_configtext('search_solr/server_port', new lang_string('solrhttpconnectionport', 'search_solr'), '', $defaultport, PARAM_INT));
43 $settings->add(new admin_setting_configtext('search_solr/server_username', new lang_string('solrauthuser', 'search_solr'), '', '', PARAM_RAW));
44 $settings->add(new admin_setting_configtext('search_solr/server_password', new lang_string('solrauthpassword', 'search_solr'), '', '', PARAM_RAW));
45 $settings->add(new admin_setting_configtext('search_solr/server_timeout', new lang_string('solrhttpconnectiontimeout', 'search_solr'), new lang_string('solrhttpconnectiontimeout_desc', 'search_solr'), 30, PARAM_INT));
46 $settings->add(new admin_setting_configtext('search_solr/ssl_cert', new lang_string('solrsslcert', 'search_solr'), new lang_string('solrsslcert_desc', 'search_solr'), '', PARAM_RAW));
95c6aeaf
DM
47 $settings->add(new admin_setting_configtext('search_solr/ssl_key', new lang_string('solrsslkey', 'search_solr'), new lang_string('solrsslkey_desc', 'search_solr'), '', PARAM_RAW));
48 $settings->add(new admin_setting_configtext('search_solr/ssl_keypassword', new lang_string('solrsslkeypassword', 'search_solr'), new lang_string('solrsslkeypassword_desc', 'search_solr'), '', PARAM_RAW));
49 $settings->add(new admin_setting_configtext('search_solr/ssl_cainfo', new lang_string('solrsslcainfo', 'search_solr'), new lang_string('solrsslcainfo_desc', 'search_solr'), '', PARAM_RAW));
50 $settings->add(new admin_setting_configtext('search_solr/ssl_capath', new lang_string('solrsslcapath', 'search_solr'), new lang_string('solrsslcapath_desc', 'search_solr'), '', PARAM_RAW));
cd894f84
EM
51
52 $settings->add(new admin_setting_heading('search_solr_fileindexing',
53 new lang_string('fileindexsettings', 'search_solr'), ''));
54 $settings->add(new admin_setting_configcheckbox('search_solr/fileindexing',
55 new lang_string('fileindexing', 'search_solr'),
56 new lang_string('fileindexing_help', 'search_solr'), 1));
57 $settings->add(new admin_setting_configtext('search_solr/maxindexfilekb',
58 new lang_string('maxindexfilekb', 'search_solr'),
0a0dc5d0 59 new lang_string('maxindexfilekb_help', 'search_solr'), '2097152', PARAM_INT));
95c6aeaf
DM
60 }
61 }
62}