|
|
(7 intermediate revisions not shown) |
Line 3: |
Line 3: |
| * Woogle'''Native''' - which is purely PHP-based - you can only search and index your Wiki as such, but no data outside the Wiki | | * Woogle'''Native''' - which is purely PHP-based - you can only search and index your Wiki as such, but no data outside the Wiki |
| * Woogle'''Remote''' - which connects to an [[Integrated Search]] backend - you can search any kind of data indexed by the backend (including e.g. file systems, SVN ressources etc.) | | * Woogle'''Remote''' - which connects to an [[Integrated Search]] backend - you can search any kind of data indexed by the backend (including e.g. file systems, SVN ressources etc.) |
| + | |
| + | If you are in a hurry, there is a less elaborate [[Woogle4MediaWiki/Quick install|quick install guide]] for WoogleNative. |
| | | |
| === Prerequisites === | | === Prerequisites === |
Line 8: |
Line 10: |
| ** Woogle4MediaWiki requires [http://www.mediawiki.org/wiki/MediaWiki MediaWiki] in a version >= 1.11.0 (see also [[Woogle4MediaWiki/Compability|compatibility notes]]) | | ** Woogle4MediaWiki requires [http://www.mediawiki.org/wiki/MediaWiki MediaWiki] in a version >= 1.11.0 (see also [[Woogle4MediaWiki/Compability|compatibility notes]]) |
| ** '''Note''': If you are using PHP 5.3.0 and beyond, some [http://us.php.net/manual/en/migration53.incompatible.php compability issues] with older versions of [https://bugzilla.wikimedia.org/show_bug.cgi?id=15854 MediaWiki] (<1.14.1) and [http://octopus13.fzi.de:8080/browse/WOO-288 Woogle] (< 1.0-RC2) will arise. Make sure to work with a recent version. | | ** '''Note''': If you are using PHP 5.3.0 and beyond, some [http://us.php.net/manual/en/migration53.incompatible.php compability issues] with older versions of [https://bugzilla.wikimedia.org/show_bug.cgi?id=15854 MediaWiki] (<1.14.1) and [http://octopus13.fzi.de:8080/browse/WOO-288 Woogle] (< 1.0-RC2) will arise. Make sure to work with a recent version. |
- | ** For WoogleNative (see above) you need a database user with <code>CREATE TABLE</code> privileges (or the database root account) | + | ** For using WoogleNative, |
- | ** For WoogleRemote you need an installed [[Integrated Search/Decider manual|Integrated Search]] backend, and some configuration data (backend URL, repoId, pushIndexAuthKey; c.f. [[Integrated_Search/Configuration#Configuring_.22push.22_indexing|for push indexing]]). A network connection from the MediaWiki server to the Integrated Search backend is required. | + | *** we strongly recommend the PCRE and mb_string extensions to be installed in your PHP runtime environment (although not strictly neccessary) |
| + | *** you will need a database user with <code>CREATE TABLE</code> privileges (or the database root account) |
| + | ** For WoogleRemote you need an installed [[Integrated Search]] backend, and some configuration data (backend URL, repoId, pushIndexAuthKey; c.f. [[Integrated_Search/Configuration#Configuring_.22push.22_indexing|for push indexing]]). A network connection from the MediaWiki server to the Integrated Search backend is required. |
| * Client | | * Client |
| ** Woogle will most probably work with any browser which is supported by MediaWiki itself (see also [[Woogle4MediaWiki/Compability|compatibility notes]]) | | ** Woogle will most probably work with any browser which is supported by MediaWiki itself (see also [[Woogle4MediaWiki/Compability|compatibility notes]]) |
Line 18: |
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 28: |
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 34: |
Line 39: |
| require_once("$IP/extensions/Woogle/Woogle.php"); | | require_once("$IP/extensions/Woogle/Woogle.php"); |
| | | |
- | // Woogle Configuration | + | // Optional Woogle Configuration |
- | WoogleConfig::set('core', false); // set false to completely dectivate Woogle | + | //WoogleConfig::set('core', false); // set false to completely dectivate Woogle |
- | WoogleConfig::set('replace', false); // set false to use MediaWiki built-in search from MediaWiki search box (Woogle is only used when directly called from Special:Woogle then) | + | //WoogleConfig::set('replace', false); // set false to use MediaWiki built-in search from MediaWiki search box (Woogle is only used when directly called from Special:Woogle then) |
- | WoogleConfig::set('advanced', false); // set false to disable Woogle:-Namespace and thus enable Special:Woogle only | + | //WoogleConfig::set('advanced', false); // set false to disable Woogle:-Namespace and thus enable Special:Woogle only |
- | WoogleConfig::set('redLinkInfo', false); // set false to disable JavaScript popups for red links | + | //WoogleConfig::set('redLinkInfo', false); // set false to disable JavaScript popups for red links |
- | WoogleConfig::set('limitAccessToGroups', true); // set true to restrict Woogle usage to groups defined in $groups below | + | //WoogleConfig::set('limitAccessToGroups', true); // set true to restrict Woogle usage to groups defined in $groups below |
- | WoogleConfig::set('groups', array('sysop')); // groups access is limited to if $limitAccessToGroups | + | //WoogleConfig::set('groups', array('sysop')); // groups access is limited to if $limitAccessToGroups |
- | WoogleConfig::set('clickTracking', false); // set false to avoid tracking of user's result clicks (for statistical purposes) | + | //WoogleConfig::set('clickTracking', false); // set false to avoid tracking of user's result clicks (for statistical purposes) |
| </pre> | | </pre> |
| | | |
Line 62: |
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 69: |
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 75: |
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 88: |
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 98: |
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 113: |
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. |