Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Global Search set-up.

Global Search set-up

From MoodleDocs

Moodle1.9

The Global Search Block is the user-side visible part of the internal Global Search Engine of Moodle, which is located in the "search" directory of the Moodle distribution.

The Global Search Block provides user with a search form interface, that will query all searchable entries in Moodle.

The searchable entries are "virtual documents" extracted from Moodle course data and database, that each activity module or block will provide to the search engine for indexing.

The search engine is based on an updated Lucene engine, part of the Zend framework.


Installing the block

The search engine itself is being part of the Moodle distribution. The block is installed as standard, but is not used on the default layout.

Setup of the global search engine

The Global Search Engine must be activated and initialized before searches can be performed.

1. Login as an administrator.

2. Access Administration > Miscellaneous > Experimental.

3. Activate the Global Search Engine by checking the enableglobalsearch box.

4. Access the Global Search settings via the link in Administration > Modules > Blocks.

5. Edit sitewide parameters of the search block. You should NOT have to change anything, unless the extra libs for converting files to text have been deployed in an unusual place.

global search params.jpg

Note that for indexing physical files, you need to get additional converters that are in the CVS at contrib/patches/global_search_libraries. I collected these converters for Windows and Linux support. Some of them may have additional support for other OS distributions.

You may activate here for indexing physical files or not. Eventually change some path setup if needed.

VERY IMPORTANT : On Linux systems, check the converters have execution permission (X set).

6. Go to the block, make a blank search.

7. Browse to the "statistics". Being administrator, you'll have additional links to perform the first-time-indexing. Once done, the cron should update the indexes with deleted, updated and added keys.

Beware : if you have many documents, this process might be heavy and time consuming. Try at night if possible.

8. The indexer will report what has been indexed for each supported module.

9. Try a search.

Converters "xxx to doc" credits

All converters were chosen for being opensource.

  • Antiword is an open source for converting Microsoft(tm) Word format in to raw text.
  • Xpdf is an open source converter for extracting raw text from Adobe(tm) Pdf.

Additional converters were produced specially for Moodle

  • Powerpoint(tm) text extractor : a special extractor algorithm designed for Moodle. This algorithm is based on a raw recognition of the internal format of .PPT files, and is based on the Office 97(tm) format.
  • HTML and XML extractors : a simple extractor that strips out any tag and markup and keeps only CDATA sequences.

Supported modules

Core modules supported

  • Forum: indexes separately "thread heads" and other posts
  • Wiki: indexes wiki pages
  • Chat: indexes sessions as a single document
  • Glossary: indexes glossary entries
  • Resource: indexes all resources, including physical files of supported types
  • Data: indexes a database entry as a single document
  • Lesson: indexes lesson pages as a single entry
  • Files: Global search does NOT index contents of documents that are stored in the Files area of the course. If you want to rely on global search, it is best to try to mention each document stored in the files area by title with a content description so they can be found more easily.

Search Scope

Searches all above modules (item title and contents) in all courses in which the current users is enrolled. Global search does not search in directories. Only linked documents will be indexed.

Non-core modules

  • Techproject: the technical project manager by Valery Fremaux

Support for other non-core modules

The search engine is extensible, and has a Document API for adding support for other modules. See the Developer Documentation.

Support for other physical document types

The Search engine has an extensible physical converter model, although adding formats may need change in the block itself (such as adding more configuration parameters). See the Developer Documentation.

See also