|
|
| Line 22: |
Line 22: |
| | * Extract the content of the Woogle distribution ZIP-file to <code>[Your MediaWiki directory]/extensions/Woogle</code> | | * Extract the content of the Woogle distribution ZIP-file to <code>[Your MediaWiki directory]/extensions/Woogle</code> |
| | * Grant write permissions for the executing user on <code>[Your MediaWiki directory]/extensions/Woogle/logs</code> and on <code>[Your MediaWiki directory]/extensions/Woogle/addons/Native/index</code>, if you are using the Native addon | | * Grant write permissions for the executing user on <code>[Your MediaWiki directory]/extensions/Woogle/logs</code> and on <code>[Your MediaWiki directory]/extensions/Woogle/addons/Native/index</code>, if you are using the Native addon |
| | + | ** If you use the latest SVN HEAD Version (instead of 1.0-RC2), also grant write permissions to <code>[Your MediaWiki directory]/extensions/Woogle/resources/tpl/compiled</code> |
| | * At the end of the file <code>[Your MediaWiki directory]/LocalSettings.php</code> add the following line: <code>require_once("$IP/extensions/Woogle/Woogle.php");</code> | | * At the end of the file <code>[Your MediaWiki directory]/LocalSettings.php</code> add the following line: <code>require_once("$IP/extensions/Woogle/Woogle.php");</code> |
| | * Proceed with configuration | | * Proceed with configuration |
| Line 32: |
Line 33: |
| | The default values plus description of all parameters can be found in <code>[Your MediaWiki directory]/extensions/Woogle/includes/WoogleConfig.php</code>. Do not modify any values there. Alternatively, you can see all configuration values on the special page <code>[MediaWiki URL]/index.php/Special:WoogleConfig</code> (e.g. [[Special:WoogleConfig]]). | | The default values plus description of all parameters can be found in <code>[Your MediaWiki directory]/extensions/Woogle/includes/WoogleConfig.php</code>. Do not modify any values there. Alternatively, you can see all configuration values on the special page <code>[MediaWiki URL]/index.php/Special:WoogleConfig</code> (e.g. [[Special:WoogleConfig]]). |
| | | | |
| - | Open the file <code>[Your MediaWiki directory]/extensions/Woogle/WoogleConfig.php</code> and scroll down to the <code>WoogleConfig</code> class to configure Woogle. You can call <code>[MediaWiki URL]/Special:WoogleConfig</code> (which requires a WikiSysop user) in your browser to see configured values at runtime. | + | Open the file <code>[Your MediaWiki directory]/extensions/Woogle/includes/WoogleConfig.php</code> and scroll down to the <code>WoogleConfig</code> class to configure Woogle. You can call <code>[MediaWiki URL]/Special:WoogleConfig</code> (which requires a WikiSysop user) in your browser to see configured values at runtime. |
| | | | |
| | Example snippet for LocalSettings.php with most important settings: | | Example snippet for LocalSettings.php with most important settings: |
| Line 66: |
Line 67: |
| | WoogleConfig::set('remoteAuthKey', 'secret'); // key for querying, only required if the backend is set to securityEnabled = true; | | WoogleConfig::set('remoteAuthKey', 'secret'); // key for querying, only required if the backend is set to securityEnabled = true; |
| | WoogleConfig::set('indexGroups', array('group1', 'group2')); | | WoogleConfig::set('indexGroups', array('group1', 'group2')); |
| - | WoogleConfig::set('indexRepository', '123'); // numeric id for indexing (repoId) - as configured in the backend repo_config.xml | + | WoogleConfig::set('indexRepository', 123); // numeric id for indexing (repoId) - as configured in the backend repo_config.xml |
| | WoogleConfig::set('remotePushIndexAuthKey', 'secret2'); // key for indexing - as configured in the backend repo_config.xml | | WoogleConfig::set('remotePushIndexAuthKey', 'secret2'); // key for indexing - as configured in the backend repo_config.xml |
| | </pre> | | </pre> |
| Line 73: |
Line 74: |
| | | | |
| | === Final steps === | | === Final steps === |
| - | * Open MediaWiki and see if the system runs properly | + | * Open MediaWiki and see if the system runs properly (if problems occur - see the [[Woogle4MediaWiki/Admin manual#Dealing_with_problems|"dealing with problems" section]] below!). |
| | * Open <code>[MediaWiki URL]/index.php/Special:WoogleConfig</code> in your browser (which requires a WikiSysop user) and check the "status" section on top | | * Open <code>[MediaWiki URL]/index.php/Special:WoogleConfig</code> in your browser (which requires a WikiSysop user) and check the "status" section on top |
| | ** For WoogleNative, click the button "Create database tables". If Woogle tells "You need db root access to create tables", your MediaWiki database user does not seem to have <code>CREATE TABLE</code> privileges (see prerequisites). You may either grant these rights via the database interface, or do the "Database adminstration via script" (see Additional topics section below) | | ** For WoogleNative, click the button "Create database tables". If Woogle tells "You need db root access to create tables", your MediaWiki database user does not seem to have <code>CREATE TABLE</code> privileges (see prerequisites). You may either grant these rights via the database interface, or do the "Database adminstration via script" (see Additional topics section below) |
| Line 79: |
Line 80: |
| | *** Select "(Re-)Create Index (Direct)" to create the index immediately, within one HTTP session. For large Wikis, this will block your browser and probably even result in a script timeout (depending on your server configuration) | | *** Select "(Re-)Create Index (Direct)" to create the index immediately, within one HTTP session. For large Wikis, this will block your browser and probably even result in a script timeout (depending on your server configuration) |
| | *** Thus you may '''alternatively''' select "(Re-)Create Index (Jobs)", which will create tasks in your MediaWiki job queue for indexing each page. The job queue usually (depending on your MediaWiki configuration) processes a handful jobs with each user request. Thus, for a large Wiki, it will take considerable time until all indexing jobs have been processed. If your Wiki has low traffic, it might even take longer. You can alread search during this process, but you might not receive full results. See "Run indexing jobs" under "Additional topcis" on how to do batch indexing. | | *** Thus you may '''alternatively''' select "(Re-)Create Index (Jobs)", which will create tasks in your MediaWiki job queue for indexing each page. The job queue usually (depending on your MediaWiki configuration) processes a handful jobs with each user request. Thus, for a large Wiki, it will take considerable time until all indexing jobs have been processed. If your Wiki has low traffic, it might even take longer. You can alread search during this process, but you might not receive full results. See "Run indexing jobs" under "Additional topcis" on how to do batch indexing. |
| - | *** For '''larger wikis''' (> 500 pages) we '''strongly recommend''' to used the command line script <code>php extensions/Woogle/maintenance/WoogleReIndexAll.php [options...]</code> for index creation! | + | *** For '''larger wikis''' (> 500 pages) we '''strongly recommend''' to used the command line script <code>php extensions/Woogle/maintenance/WoogleReIndexAll.php [options...]</code> for index creation! ([[Woogle4MediaWiki/Admin manual#Indexing_via_script|see below for details]]) |
| | * Enter <code>[MediaWiki URL]/index.php/Special:Woogle</code> to your browser to check if everything works | | * Enter <code>[MediaWiki URL]/index.php/Special:Woogle</code> to your browser to check if everything works |
| | | | |
| Line 92: |
Line 93: |
| | == Additional topcis == | | == Additional topcis == |
| | | | |
| - | === Database adminstration via script === | + | === Dealing with problems === |
| | + | If problems occur, you might first see [[Woogle4MediaWiki/FAQ#Administrator_questions|the FAQ]]. |
| | + | |
| | + | If you see a blank page after enabling Woogle, adding the following code to your <code>LocalSettings.php</code> might help to track down the problem: |
| | + | <pre> |
| | + | # Error reporting (only useful for debugging) |
| | + | error_reporting( E_ALL ); |
| | + | ini_set( 'display_errors', 1 ); |
| | + | $wgShowExceptionDetails = true; |
| | + | $wgShowSQLErrors = true; |
| | + | </pre> |
| | + | |
| | + | === Database administration via script === |
| | If your MediaWiki database user does not have sufficient privileges to add/delete tables, you have to use the command line script instead of conveniently using the buttons at Special:WoogleConfig. | | If your MediaWiki database user does not have sufficient privileges to add/delete tables, you have to use the command line script instead of conveniently using the buttons at Special:WoogleConfig. |
| | | | |
| Line 102: |
Line 115: |
| | * <code>--delete</code> Delete Woogle database tables. If not selected, this script tries to create them. | | * <code>--delete</code> Delete Woogle database tables. If not selected, this script tries to create them. |
| | | | |
| - | === Run indexing jobs === | + | === Indexing via script === |
| - | If you chose to "index as jobs" in a large Wiki, this might produce a huge job queue which takes a while to fill the index, since in MediaWiki, a small fraction of jobs is processed with every user request. However, MediaWiki provides a script <code>/maintenance/runJobs.php</code> to process the job queue from the command line. Follow the [http://www.mediawiki.org/wiki/Manual:Job_queue MediaWiki manual] concerning this option. | + | Especially for larger Wikis, it makes sense to run indexing tasks from the command line instead of the web browser. There are two scripts, that can support you with this task: |
| | + | * <code>php extensions/Woogle/maintenance/WoogleReIndexAll.php [options...]</code> is our recommended approach, since it will rebuild the index without any further prerequisites. The following options can be set: |
| | + | ** <code>-f</code> to force indexing without 10 sec waiting delay |
| | + | ** <code>--server=http://www.mywikihost.org</code> - server name (e.g. http://www.mywikihost.org) - without trailing slashes - to avoid that Woogle stores Wiki page URLs with <code>http://localhost</code> in the index. Alternatively set $wgServer explicitly in LocalSettings.php (c.f. [http://www.mediawiki.org/wiki/Manual:LocalSettings.php#Server_name]). |
| | + | ** <code>--conf=../../../LocalSettings2.php</code> - this is only necessary, but particularly useful, if you would like to create an index without touching the productive Wiki system (which is configured in LocalSettings.php). You may just make a copy of LocalSettings.php and only include Woogle in this configuration. |
| | + | * If you chose to "index as jobs" in <code>Special:WoogleConfig</code>, Woogle will add small indexing jobs (one job for each Wiki page) to the MediaWiki job system. In a large Wiki, this might produce a huge job queue which takes a while to fill the index, since in MediaWiki, a small fraction of jobs is processed with every user request. However, MediaWiki provides a script <code>/maintenance/runJobs.php</code> to process the job queue from the command line. Follow the [http://www.mediawiki.org/wiki/Manual:Job_queue MediaWiki manual] concerning this option. |
| | | | |
| | === Modify or translate UI text === | | === Modify or translate UI text === |
| Line 117: |
Line 135: |
| | | | |
| | Instrumentation mode can be enabled by setting <code>$config['instrumentation']</code> in <code>extensions\Woogle\addons\Instrumentation\Instrumentation.php</code> to "true". Further settings can be changed there as well. | | Instrumentation mode can be enabled by setting <code>$config['instrumentation']</code> in <code>extensions\Woogle\addons\Instrumentation\Instrumentation.php</code> to "true". Further settings can be changed there as well. |
| | + | |
| | + | See [[Woogle4MediaWiki/Instrumentation addon]] for detailed information. |