<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shashitechno</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shashitechno"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Shashitechno"/>
	<updated>2026-04-21T17:49:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Events_API&amp;diff=44056</id>
		<title>Events API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Events_API&amp;diff=44056"/>
		<updated>2014-03-04T16:44:32Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Why is a new events system needed? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Events 2&lt;br /&gt;
|state = Implementation in progress&lt;br /&gt;
|tracker = MDL-39797 , MDL-39952, MDL-39846&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/discuss.php?d=229425&lt;br /&gt;
|assignee = Backend Team&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= What are events? =&lt;br /&gt;
&lt;br /&gt;
Events are atomic pieces of information describing something that happened in Moodle. Events are primarily the result of user actions, but could also be the result of the [[:en:Cron|cron]] process or administration actions [[:en:Administration via command line|undertaken via the command line]].&lt;br /&gt;
&lt;br /&gt;
When an action takes place, an event is created by a [[Core APIs|core API]] or [[Plugins|plugin]]. The Events system then disseminates this event information to observers registered for this event. In this way, the events system acts as a communication backbone throughout the Moodle system.&lt;br /&gt;
&lt;br /&gt;
Event observers can not modify event data or interrupt the dispatching of events, it is a one way communication channel.&lt;br /&gt;
&lt;br /&gt;
= Why is a new events system needed? =&lt;br /&gt;
&lt;br /&gt;
The need to improve the Events system was prompted by a need for a richer and more efficient logging system, however the benefits of this improvement will be useful to other parts of Moodle that observe event information.&lt;br /&gt;
&lt;br /&gt;
* The events need to be more strictly defined if we want to use them for new logging and other advanced use cases. They need to contain a lot more information in a standardised way (such as most fields from current log table and log_actions table).&lt;br /&gt;
* Complex data types were allowed in old events which was causing major problems when serialising/storing/unserializing the data.&lt;br /&gt;
* The logging and events contain similar information and are triggered at the same places, new events would remove this code duplication. All events should be loggable and all current log entries should be triggered as events.&lt;br /&gt;
* The logging system will become an event observer, listening to all events and directing them to logging storage plugins in a controllable way.&lt;br /&gt;
* It will be possible to subscribe to &#039;*&#039; event, which would allow a system to potentially observe, and selectively deal with, all events. Current handlers do not get event name which makes this problematic.&lt;br /&gt;
* Current event handlers may trigger exceptions during site upgrade which would lead to fatal upgrade problems. The new design eliminates this.&lt;br /&gt;
* Failure in handlers blocked dispatching of subsequent events. Instead problems in new observers would be only logged and execution would continue normally.&lt;br /&gt;
* Current execution of external handlers during DB transactions blocks other handlers. This would be eliminated by in-memory buffer for external events.&lt;br /&gt;
* It would good to have observer priority.&lt;br /&gt;
* Nested events are not dispatched sequentially, it would change the order of events received in lower priority handlers.&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
Some basic profiling has been conducted.&lt;br /&gt;
&lt;br /&gt;
There is a general plan to complete pre- and post-implementation testing as development happens. The new system will be imemented in parallel with the old one which should help with comparison of new and old logging and event triggering performance on each page.&lt;br /&gt;
&lt;br /&gt;
Our aim is to trigger more events and log more information, which is going to impact on performance. We hope to offset that impact by improving log storage, simplifying event dispatching and adding other core performance improvements. The proposed class structure of the base event should allow some new advanced techniques, which may also improve performance in some scenarios.&lt;br /&gt;
&lt;br /&gt;
More details will be added to this section soon.&lt;br /&gt;
&lt;br /&gt;
= Events API =&lt;br /&gt;
&lt;br /&gt;
Each plugin will define the events that it can report (trigger) by extending an abstract base class, once for each possible event. This approach will have several benefits.&lt;br /&gt;
; Events will be active objects&lt;br /&gt;
: When they are triggered and possibly after they are reinstantiated (say, when they are retrieved from a log), an event object will be able to provide callback functions for various purposes (such as capability checks).&lt;br /&gt;
; Automatic inclusion&lt;br /&gt;
: Event class definitions will be automatically included when needed, without having to maintain lists of known event types. New event definitions can be added without the need to upgrade, only purging of MUC cache is required after adding new observer.&lt;br /&gt;
; Maintainability&lt;br /&gt;
: It will be easy to add new events and migrate existing events. Code review will be simplified because there will be less duplication of code when triggering events and all event related information/code will be concentrated in one file in fixed locations.&lt;br /&gt;
; Self documenting&lt;br /&gt;
: The behaviour of events will be combined with the definition of events in one place (file). It will be easy for event observer writers to know what events a plugin can trigger. This includes support for autocompletion and code inspection in modern IDEs.&lt;br /&gt;
; Quick, self-validating data structure&lt;br /&gt;
: As events are instantiated objects, the PHP processor will validate the structure and type of event classes. This does not ensure data value validity, but does give some assurance of consistency and it also detects common typos.&lt;br /&gt;
&lt;br /&gt;
== Backwards compatibility and migration ==&lt;br /&gt;
&lt;br /&gt;
Events:&lt;br /&gt;
* Moodle core and standard plugins will replace all calls to the events_trigger() function with new events classes.&lt;br /&gt;
* For events that already exist in Moodle 2.5 the additional legacy information should be added to the event data (in properties &#039;legacyeventname&#039; and &#039;legacyeventdata&#039;.&lt;br /&gt;
* The function events_trigger() will continue working as before, but it will be called automatically after a new event is processed using the &#039;legacyeventname&#039; and &#039;legacyeventdata&#039;.&lt;br /&gt;
* The legacy events handling code will be maintained  separately and will continue being supported in Moodle 2.x. New legacy events will not be added.&lt;br /&gt;
* Existing legacy event handlers will be migrated to new event handlers accepting new event class instances.&lt;br /&gt;
* More subsystems may be migrated to events-handlers, ex.: gradebook history.&lt;br /&gt;
&lt;br /&gt;
Logging:&lt;br /&gt;
* Function add_to_log() and all logging internals will continue working as before.&lt;br /&gt;
* Existing add_to_log() parameters will be migrated inside new events method get_legacy_log_data() and core_event_base::trigger() will call add_to_log() automatically (this will depend on $CFG-&amp;gt;loglifetime setting for performance reasons).&lt;br /&gt;
&lt;br /&gt;
== Event dispatching and observers ==&lt;br /&gt;
&lt;br /&gt;
The new event dispatching system is completely separate from the old events code. Original event handlers are now called observers with the description stored in the same db/events.php file, but as a new array with a different format.&lt;br /&gt;
&lt;br /&gt;
=== Event observers ===&lt;br /&gt;
&lt;br /&gt;
The observers are described in db/events.php in the array $observers, the array is not indexed and contains a list of observers defined as an array with the following properties;&lt;br /&gt;
* eventname - event class name or &amp;quot;*&amp;quot; indicating all events. All events must use namespace, ex.: &#039;&#039;\plugintype_pluginname\event\something_happened&#039;&#039;.&lt;br /&gt;
* callback - PHP callable type.&lt;br /&gt;
* includefile - optional. File to be included before calling the observer. Path relative to dirroot.&lt;br /&gt;
* priority - optional. Defaults to 0. Observers with higher priority are notified first.&lt;br /&gt;
* internal - optional. Defaults to true. Non-internal observers are not called during database transactions, but instead after a successful commit of the transaction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$observers = array(&lt;br /&gt;
&lt;br /&gt;
    array(&lt;br /&gt;
        &#039;eventname&#039;   =&amp;gt; &#039;\core\event\sample_executed&#039;,&lt;br /&gt;
        &#039;callback&#039;    =&amp;gt; &#039;core_event_sample_observer::observe_one&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    array(&lt;br /&gt;
        &#039;eventname&#039;   =&amp;gt; &#039;\core\event\sample_executed&#039;,&lt;br /&gt;
        &#039;callback&#039;    =&amp;gt; &#039;core_event_sample_observer::external_observer&#039;,&lt;br /&gt;
        &#039;priority&#039;    =&amp;gt; 200,&lt;br /&gt;
        &#039;internal&#039;    =&amp;gt; false,&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    array(&lt;br /&gt;
        &#039;eventname&#039;   =&amp;gt; &#039;*&#039;,&lt;br /&gt;
        &#039;callback&#039;    =&amp;gt; &#039;core_event_sample_observer::observe_all&#039;,&lt;br /&gt;
        &#039;includefile&#039; =&amp;gt; null,&lt;br /&gt;
        &#039;internal&#039;    =&amp;gt; true,&lt;br /&gt;
        &#039;priority&#039;    =&amp;gt; 9999,&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Event dispatching ===&lt;br /&gt;
&lt;br /&gt;
A list of available observers is constructed on the fly directly from all available events.php files. Previously handlers were installed only during installation and upgrade. There is no risk of performance regression because the list is already cached in MUC. Observers get events before installation or any upgrade, however observers are not notified during the initial installation of moodle core tables.&lt;br /&gt;
&lt;br /&gt;
Developers of observers must make sure that execution does not end with a fatal error under any condition (before install, before upgrade or normal operation). Exceptions are automatically captured, logged in the PHP error log, and notification of other observers continues. Current handlers must not throw any exceptions at any time.&lt;br /&gt;
&lt;br /&gt;
Observers are notified sequentially in the same order in which events were triggered. This means that events triggered in observers are queued in FIFO buffer and are processed after all observers are notified.&lt;br /&gt;
&lt;br /&gt;
=== Differences from old event handling ===&lt;br /&gt;
&lt;br /&gt;
# New events contain a lot more structured information.&lt;br /&gt;
# New event data must not contain any PHP classes.&lt;br /&gt;
# There is separate context cache which may be used when deleting data or for observer performance improvements.&lt;br /&gt;
# No database access in new event dispatching code.&lt;br /&gt;
# There is no support for cron execution - this eliminates performance problems, simplifies events dispatching and prevents abuse of cron events.&lt;br /&gt;
# Events triggered in observers are processed in a different order.&lt;br /&gt;
# External events are buffered when a transaction is in progress, instead of being sent to the cron queue.&lt;br /&gt;
# It is possible to define multiple observers for one event in one events.php file.&lt;br /&gt;
# It is possible to subscribe an observer to all events.&lt;br /&gt;
# The new event manager is using frankenstyle autoloading - smaller memory footprint when events are not used on the current page.&lt;br /&gt;
&lt;br /&gt;
== Triggering events ==&lt;br /&gt;
&lt;br /&gt;
* All event descriptions are objects extending the \core\event\base class.&lt;br /&gt;
* Events are triggered by creating a new instance of the class event and executing $event-&amp;gt;trigger().&lt;br /&gt;
* Each event class name is a unique identifier of the event.&lt;br /&gt;
* Class names and namespace follow the identifier scheme \&#039;&#039;&#039;frankenstyle_component&#039;&#039;&#039;\event\&#039;&#039;&#039;some_object_action&#039;&#039;&#039;. Core events have prefix &#039;core_&#039;.&lt;br /&gt;
* Plugins define each event class in a separate file. File name and location must match the class name, for example: &#039;&#039;&#039;plugindir&#039;&#039;&#039;/classes/event/&#039;&#039;&#039;something_happened&#039;&#039;&#039;.php&lt;br /&gt;
* The event identifier suffix has the form &#039;&#039;some_object_action&#039;&#039;  (&#039;&#039;&#039;something_happened&#039;&#039;&#039; in the example above) and should follow our standard naming convention. The last word after underscore is automatically parsed as action, the rest of words is object.&lt;br /&gt;
&lt;br /&gt;
Decision:[[#Verb_list| Recommended verb list]]&lt;br /&gt;
&lt;br /&gt;
Examples: \core\event\course_completed, \mod_assign\event\submission_commented, \mod_forum\event\post_shared, \mod_forum\event\post_responded, etc.&lt;br /&gt;
&lt;br /&gt;
* Ideally, it should be possible to trigger an event without gathering additional information for the event. To reduce the cost of data gathering, specifically the cost of database reads, at least the minimal values needed to trigger an event should be already available in variables.&lt;br /&gt;
&lt;br /&gt;
An example of triggering an event:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$event = \mod_myplugin\event\something_happened::create(array(&#039;context&#039; =&amp;gt; $context, &#039;objectid&#039; =&amp;gt; YYY, &#039;other&#039; =&amp;gt; ZZZ));&lt;br /&gt;
// ... code that may add some record snapshots&lt;br /&gt;
$event-&amp;gt;trigger();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Use of php autoloading ===&lt;br /&gt;
&lt;br /&gt;
All new OOP APIs in Moodle 2.6 are going to use class auto loading - see [[Automatic class loading]]. New events use PHP strictly defined namespaces which concentrate all events classes in classes/event/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Why separate classes? ===&lt;br /&gt;
There were two alternatives proposed on how to define the event structure. The first is a separate class for each event (extending the base class), the other being each event is based on a generic event instance of the base class.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Decision: Use separate class for each event.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Each plugin creates its own event class for each event&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Pros&lt;br /&gt;
* Maintainability - It is much easier to review, debug, integrate.&lt;br /&gt;
* Self documenting, behaviour is combined with definition.&lt;br /&gt;
* It is extremely flexible for plugin developers and core devs too.&lt;br /&gt;
* Automatically lists events without being installed - PHPDocs as events documentation.&lt;br /&gt;
* It is included only when needed using autoloading.&lt;br /&gt;
* Self-validating data structure (by PHP).&lt;br /&gt;
* Some developers will find it easier to copy whole class files as templates.&lt;br /&gt;
Cons&lt;br /&gt;
* Big learning curve for developers without OOP skills (all other new subsystems in Moodle already use OOP, you can not code without these skills any more).&lt;br /&gt;
* Some developers may find it harder to copy-and-paste examples because they will need to create new class first and use it afterwards (this can be viewed as a benefit because it forces developers to think more about events).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Each plugin defines events in a list based on a generic object&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Pros&lt;br /&gt;
* Easier for some developers (this can be eliminated with developer documentation).&lt;br /&gt;
* Some developers think it gives more control of event structure in core (we can easily solve that with private access and validation in the base class).&lt;br /&gt;
Cons&lt;br /&gt;
* It is not flexible enough. PHP code gives developers more freedom.&lt;br /&gt;
* It would not be possible to implement any performance hacks in custom methods. All data would have to be calculated even if it is not used.&lt;br /&gt;
* It would be necessary to define access control callbacks in other code.&lt;br /&gt;
* It would be harder and slower to integrate legacy logging.&lt;br /&gt;
* It would be harder and slower to implement support for legacy events.&lt;br /&gt;
* Event observers could not use event class names as reliable identifiers.&lt;br /&gt;
* Event object and action could not be parsed from class name, it would have to be stored in event properties every time you trigger event.&lt;br /&gt;
* Requires upgrade/install to register an event in DB table with MUC cache. Events could not be triggered earlier.&lt;br /&gt;
* The localised descriptions and names would have to be stored as properties, it would not be possible to store them in any definition.&lt;br /&gt;
* The implementation of an events infrastructure would be significantly more complex and error prone.&lt;br /&gt;
&lt;br /&gt;
== Information contained in events ==&lt;br /&gt;
&lt;br /&gt;
Events have to contain as much information as they can, but this should not affect the performance. That&#039;s why part of the information is available in properties, and the rest via methods. This allows for delaying the computation of the data at the time it is really needed, if it ever is.&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
&lt;br /&gt;
List of properties that the developer has to pass to the event upon creation, or automatically generated when possible and cost free. Some of those properties not mandatory.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property name&lt;br /&gt;
! Title&lt;br /&gt;
! Type&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;eventname&#039;&#039;&lt;br /&gt;
| Event name&lt;br /&gt;
| &#039;&#039;static, automatic from class name&#039;&#039;&lt;br /&gt;
| Automatically computed by copying class name&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;component&#039;&#039;&lt;br /&gt;
| Component&lt;br /&gt;
| &#039;&#039;static, automatic from top namespace&#039;&#039;&lt;br /&gt;
| Component declaring the event, automatically computed from class name.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;action&#039;&#039;&lt;br /&gt;
| Action&lt;br /&gt;
| &#039;&#039;static, automatic from last word in class name&#039;&#039;&lt;br /&gt;
| Can be automatically computed from class name.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;target&#039;&#039;&lt;br /&gt;
| target of action&lt;br /&gt;
| &#039;&#039;static, automatic from class name&#039;&#039;&lt;br /&gt;
| Target on which the action is taken, can be automatically computed from class name.&lt;br /&gt;
|-&lt;br /&gt;
| objecttable&lt;br /&gt;
| Database table name&lt;br /&gt;
|&lt;br /&gt;
| optional database table name where is/was the object stored. Never use a relationship table here.&lt;br /&gt;
|-&lt;br /&gt;
| objectid&lt;br /&gt;
| Object ID&lt;br /&gt;
|&lt;br /&gt;
| optional id of the object record from objecttable&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;crud&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| Transaction type&lt;br /&gt;
| &#039;&#039;static mandatory&#039;&#039;&lt;br /&gt;
| One of [crud] letters. Statically declared in the event class method init().&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;level&#039;&#039;&#039;&#039;&#039; / &#039;&#039;&#039;&#039;&#039;edulevel&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| Level&lt;br /&gt;
| &#039;&#039;static mandatory&#039;&#039;&lt;br /&gt;
| Level of educational value of the event. Statically declared in the event class method init(). Changed from &#039;&#039;&#039;&#039;&#039;level&#039;&#039;&#039;&#039;&#039; to &#039;&#039;&#039;&#039;&#039;edulevel&#039;&#039;&#039;&#039;&#039; in Moodle 2.7 (See below for more details)&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| Context ID&lt;br /&gt;
| mandatory&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| contextlevel&lt;br /&gt;
| Context level&lt;br /&gt;
| automatic from context&lt;br /&gt;
| This tells you if it was a course, activity, course category, etc.&lt;br /&gt;
|-&lt;br /&gt;
| contextinstanceid&lt;br /&gt;
| Context instanceid&lt;br /&gt;
| automatic from context&lt;br /&gt;
| Based on context level this may be course id , course module id, course category, etc.&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| User ID&lt;br /&gt;
| defaults to current user&lt;br /&gt;
| User ID, or 0 when not logged in, or -1 when other (System, CLI, Cron, ...)&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| Affected course&lt;br /&gt;
| defaults to course context from context&lt;br /&gt;
| This is used only for contexts at and bellow course level - this can be used to filter events by course (includes all course activities)&lt;br /&gt;
|-&lt;br /&gt;
| relateduserid&lt;br /&gt;
| Affected user&lt;br /&gt;
|&lt;br /&gt;
| Is this action related to some user? This could be used for some personal timeline view.&lt;br /&gt;
|-&lt;br /&gt;
| other&lt;br /&gt;
| All other data&lt;br /&gt;
|&lt;br /&gt;
| Any other fields needed for event description - scalars or arrays, must be serialisable using json_encode()&lt;br /&gt;
|-&lt;br /&gt;
| timecreated&lt;br /&gt;
| Time of the event&lt;br /&gt;
| automatic&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;static&#039;&#039;: It is the same for all event instances of this class.&lt;br /&gt;
* &#039;&#039;&#039;mandatory&#039;&#039;&#039;: Is required in order to trigger the event.&lt;br /&gt;
&lt;br /&gt;
==== Level property ====&lt;br /&gt;
&lt;br /&gt;
The edulevel property helps defining the educational value of the event. It is intentional that the list is limited to only 3 different constants, having too many options would make it harder for developers to pick the right one(s). We also have to keep in mind that this is not supposed to answer all the questions about a particular event, other event properties like the courseid, the context, the component name can be used with the level to get more granular reports.&lt;br /&gt;
&lt;br /&gt;
Remember that this is event based. If the user that has triggered the event is not really &amp;quot;participating&amp;quot; because he is an admin, or a manager, then it is the job of the report to filter those. The event itself has a static educational level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Teaching&#039;&#039;&#039; (LEVEL_TEACHING: 1)&lt;br /&gt;
&lt;br /&gt;
Any event/action that is performed by someone (typically a teacher) and has a teaching value (anything that is affecting the learning experience/environment of the students). This should not be combined with &amp;quot;Participating&amp;quot; events.&lt;br /&gt;
&lt;br /&gt;
Valid events:&lt;br /&gt;
&lt;br /&gt;
* A teacher grading a student&lt;br /&gt;
* A teacher modifying the course settings&lt;br /&gt;
* A teacher adding a new section to the course page&lt;br /&gt;
* A teacher modifying a module settings&lt;br /&gt;
* A teacher adding a page to course&lt;br /&gt;
* A teacher leaving a feedback&lt;br /&gt;
&lt;br /&gt;
INVALID events:&lt;br /&gt;
&lt;br /&gt;
* A teacher posting in a forum (it might affect the learning experience, but not necessarily, so the teacher is just participating)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Participating&#039;&#039;&#039; (LEVEL_PARTICIPATING: 2)&lt;br /&gt;
&lt;br /&gt;
Any event/action that is performed by a user, that is related (or could be related) to his learning experience.&lt;br /&gt;
&lt;br /&gt;
Valid events:&lt;br /&gt;
&lt;br /&gt;
* A user posting to a forum&lt;br /&gt;
* A user submitting an assignment&lt;br /&gt;
* A user blogging&lt;br /&gt;
* A user reading someone&#039;s blog&lt;br /&gt;
* A user posting a comment&lt;br /&gt;
* A user chatting on a chat activity&lt;br /&gt;
* A user viewing the course page&lt;br /&gt;
* A user deletes a blog post&lt;br /&gt;
&lt;br /&gt;
INVALID events:&lt;br /&gt;
&lt;br /&gt;
* A user updating his profile&lt;br /&gt;
* A user visiting someone&#039;s profile&lt;br /&gt;
* A user viewing his /my/ page&lt;br /&gt;
* A user sending a message to another one&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039; (LEVEL_OTHER: 0)&lt;br /&gt;
&lt;br /&gt;
Any other action, whether they are related to the site administration, or are specific to user. They do not have any educational value.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
The computation of this data is not required by default, but can be accessed by any event observer if need be.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| get_name()&lt;br /&gt;
| Returns localised name of the event, it is the same for all instances.&lt;br /&gt;
|-&lt;br /&gt;
| get_description()&lt;br /&gt;
| Returns localised description of one particular event.&lt;br /&gt;
|-&lt;br /&gt;
| can_view($user)&lt;br /&gt;
| Can the specified user view the event?&lt;br /&gt;
|-&lt;br /&gt;
| get_url()&lt;br /&gt;
| Returns Moodle URL where the event can be observed afterwards.&lt;br /&gt;
|-&lt;br /&gt;
| get_legacy_eventname()&lt;br /&gt;
| Information necessary for event BC.&lt;br /&gt;
|-&lt;br /&gt;
| get_legacy_eventdata()&lt;br /&gt;
| Information necessary for event BC.&lt;br /&gt;
|-&lt;br /&gt;
| get_legacy_logdata()&lt;br /&gt;
| Information necessary for logging BC.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Record caching===&lt;br /&gt;
&lt;br /&gt;
The standard event data may not contain all the information observers need. The built-in record snapshot support in events allows developers to attach more auxiliary information when triggering events, it may be for example course record, some record that was just deleted, etc. The snapshot is meant to be a full database record, as it will be automatically fetched from get_record_snapshot() if not set previously and assuming the property &#039;&#039;objecttable&#039;&#039; is set. Please be aware that the snapshots are not stored in the event, and cannot be restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    $event = \core\event\role_assigned::create(&lt;br /&gt;
        array(&#039;context&#039;=&amp;gt;$context, &#039;objectid&#039;=&amp;gt;$ra-&amp;gt;roleid, &#039;relateduserid&#039;=&amp;gt;$ra-&amp;gt;userid,&lt;br /&gt;
            &#039;other&#039;=&amp;gt;array(&#039;id&#039;=&amp;gt;$ra-&amp;gt;id, &#039;component&#039;=&amp;gt;$ra-&amp;gt;component, &#039;itemid&#039;=&amp;gt;$ra-&amp;gt;itemid)));&lt;br /&gt;
    $event-&amp;gt;add_record_snapshot(&#039;role_assignments&#039;, $ra);&lt;br /&gt;
    $event-&amp;gt;trigger();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    $event = \core\event\role_unassigned::create(&lt;br /&gt;
        array(&#039;context&#039;=&amp;gt;$context, &#039;objectid&#039;=&amp;gt;$ra-&amp;gt;roleid, &#039;relateduserid&#039;=&amp;gt;$ra-&amp;gt;userid,&lt;br /&gt;
            &#039;other&#039;=&amp;gt;array(&#039;id&#039;=&amp;gt;$ra-&amp;gt;id, &#039;component&#039;=&amp;gt;$ra-&amp;gt;component, &#039;itemid&#039;=&amp;gt;$ra-&amp;gt;itemid)));&lt;br /&gt;
    $event-&amp;gt;add_record_snapshot(&#039;role_assignments&#039;, $ra);&lt;br /&gt;
    $event-&amp;gt;trigger();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The related methods are:&lt;br /&gt;
* public function add_record_snapshot($tablename, $record)&lt;br /&gt;
* public function get_record_snapshot($tablename, $id)&lt;br /&gt;
&lt;br /&gt;
=== Rejected properties and methods ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property&lt;br /&gt;
! Title&lt;br /&gt;
! Why&lt;br /&gt;
|-&lt;br /&gt;
| URL&lt;br /&gt;
| relevant page URL&lt;br /&gt;
| These URLs can be constructed on the fly from other data, external log plugins may use get_url() method.&lt;br /&gt;
|-&lt;br /&gt;
| version&lt;br /&gt;
| Event specification number&lt;br /&gt;
| The event specification should never change&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| Type of event (action, error, ...)&lt;br /&gt;
| Event are not intended for error logging or debugging.&lt;br /&gt;
|-&lt;br /&gt;
| actor&lt;br /&gt;
| Whether current execution is cron, cli, user, ...&lt;br /&gt;
| Impossible to track down at a low level&lt;br /&gt;
|-&lt;br /&gt;
| severity&lt;br /&gt;
| Severity following [http://tools.ietf.org/html/rfc5424#section-6.2.1 logging standards]&lt;br /&gt;
| Our logging does not match this, as we will not (at present) log errors&lt;br /&gt;
|-&lt;br /&gt;
| coursecatname&lt;br /&gt;
| Category name&lt;br /&gt;
| Might be costly to retrieve for little gain&lt;br /&gt;
|-&lt;br /&gt;
| coursename&lt;br /&gt;
| Course name&lt;br /&gt;
| Might be costly to retrieve for little gain&lt;br /&gt;
|-&lt;br /&gt;
| cmname&lt;br /&gt;
| Course module name&lt;br /&gt;
| Might be costly to retrieve for little gain&lt;br /&gt;
|-&lt;br /&gt;
| categoryid &lt;br /&gt;
| Course category id&lt;br /&gt;
| Categories are a tree structure, we can not identify them by one integer. It would have to be a path.&lt;br /&gt;
|-&lt;br /&gt;
| cmid &lt;br /&gt;
| Course module id&lt;br /&gt;
| Can be derived from contextlevel and contextinstanceid&lt;br /&gt;
|-&lt;br /&gt;
| associatedobject&lt;br /&gt;
| Associated object&lt;br /&gt;
| Object associated to the main object. Ie: The user to whom a message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| associatedobjectid&lt;br /&gt;
| Associated object ID&lt;br /&gt;
| Identifier of the associated object&lt;br /&gt;
|-&lt;br /&gt;
| realuserid&lt;br /&gt;
| Real User ID&lt;br /&gt;
| Will be tracked by log plugins only - user who &amp;quot;logged in as&amp;quot;, stores the real user ID&lt;br /&gt;
|-&lt;br /&gt;
| origin&lt;br /&gt;
| Origin of the event&lt;br /&gt;
| Will be tracked by log plugins only - CLI, cron, Webservice, ... (optionally with IP address)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method&lt;br /&gt;
! Comment&lt;br /&gt;
! Why&lt;br /&gt;
|-&lt;br /&gt;
| get_all_affected_users()&lt;br /&gt;
| Returns all the users affected by this event&lt;br /&gt;
| It is expensive to fetch all users and it changes in time, so it would be unreliable too. For now we store only one user who is related to each event.&lt;br /&gt;
|-&lt;br /&gt;
| get_objecturl()&lt;br /&gt;
| Returns the URL to view the object&lt;br /&gt;
| There is usually only one URL where event changes may be observed. The URL may depend on current user capabilities too.&lt;br /&gt;
|-&lt;br /&gt;
| get_associatedobjecturl()&lt;br /&gt;
| Returns the URL to view the associated object&lt;br /&gt;
| No associated user property is present.&lt;br /&gt;
|-&lt;br /&gt;
| get_currenturl()&lt;br /&gt;
| Returns the current URL, uses $PAGE.&lt;br /&gt;
| This information may be added by logger, current page info is not part of events data.&lt;br /&gt;
|-&lt;br /&gt;
| get_useripaddress()&lt;br /&gt;
| Returns the User IP address&lt;br /&gt;
| Page access method is not part of events API, this should be implemented as logdata properties in loggers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Events naming convention ==&lt;br /&gt;
&lt;br /&gt;
Clear event names help developers when reading what events are triggered, and defining the events properties when defining the event class.&lt;br /&gt;
&lt;br /&gt;
 Decision: \&amp;lt;component&amp;gt;\event\&amp;lt;some_object&amp;gt;_&amp;lt;verb&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Existing events ===&lt;br /&gt;
&lt;br /&gt;
List of existing events in Moodle code base, along with their 2.5 couterparts.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Fully qualified event name&lt;br /&gt;
! 2.5 name&lt;br /&gt;
! Component&lt;br /&gt;
! Object&lt;br /&gt;
! Action (Verb)&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_comments\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_comments&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_comments\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_comments&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_file\event\assessable_uploaded&#039;&#039;&#039;&lt;br /&gt;
| assessable_file_uploaded&lt;br /&gt;
| assignsubmission_file&lt;br /&gt;
| assessable&lt;br /&gt;
| uploaded&lt;br /&gt;
| To be deprecated MDL-35197&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_file\event\submission_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_file&lt;br /&gt;
| submission&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_file\event\submission_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_file&lt;br /&gt;
| submission&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_onlinetext\event\assessable_uploaded&#039;&#039;&#039;&lt;br /&gt;
| assessable_content_uploaded&lt;br /&gt;
| assignsubmission_onlinetext&lt;br /&gt;
| assessable&lt;br /&gt;
| uploaded&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_onlinetext\event\submission_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_onlinetext&lt;br /&gt;
| submission&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;assignsubmission_onlinetext\event\submission_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| assignsubmission_onlinetext&lt;br /&gt;
| submission&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;block_comments\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| block_comments&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;block_comments\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| block_comments&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;booktool_exportimscp\event\book_exported&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| booktool_exportimscp&lt;br /&gt;
| book&lt;br /&gt;
| exported&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;booktool_print\event\book_printed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| booktool_print&lt;br /&gt;
| book&lt;br /&gt;
| printed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;booktool_print\event\chapter_printed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| booktool_print&lt;br /&gt;
| chapter&lt;br /&gt;
| printed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\assessable_submitted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| assessable&lt;br /&gt;
| submitted&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\assessable_uploaded&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| assessable&lt;br /&gt;
| uploaded&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\base&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| base&lt;br /&gt;
| ase&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_association_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| blog_association&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| blog_comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| blog_comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_entries_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| blog_entries&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_entry_created&#039;&#039;&#039;&lt;br /&gt;
| blog_entry_added&lt;br /&gt;
| core&lt;br /&gt;
| blog_entry&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_entry_deleted&#039;&#039;&#039;&lt;br /&gt;
| blog_entry_deleted&lt;br /&gt;
| core&lt;br /&gt;
| blog_entry&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\blog_entry_updated&#039;&#039;&#039;&lt;br /&gt;
| blog_entry_edited&lt;br /&gt;
| core&lt;br /&gt;
| blog_entry&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\cohort_created&#039;&#039;&#039;&lt;br /&gt;
| cohort_added&lt;br /&gt;
| core&lt;br /&gt;
| cohort&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\cohort_deleted&#039;&#039;&#039;&lt;br /&gt;
| cohort_deleted&lt;br /&gt;
| core&lt;br /&gt;
| cohort&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\cohort_member_added&#039;&#039;&#039;&lt;br /&gt;
| cohort_member_added&lt;br /&gt;
| core&lt;br /&gt;
| cohort_member&lt;br /&gt;
| added&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\cohort_member_removed&#039;&#039;&#039;&lt;br /&gt;
| cohort_member_removed&lt;br /&gt;
| core&lt;br /&gt;
| cohort_member&lt;br /&gt;
| removed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\cohort_updated&#039;&#039;&#039;&lt;br /&gt;
| cohort_updated&lt;br /&gt;
| core&lt;br /&gt;
| cohort&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\comments_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| comments&lt;br /&gt;
| viewed&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_category_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_category&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_category_deleted&#039;&#039;&#039;&lt;br /&gt;
| course_category_deleted&lt;br /&gt;
| core&lt;br /&gt;
| course_category&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_category_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_category&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_completed&#039;&#039;&#039;&lt;br /&gt;
| course_completed&lt;br /&gt;
| core&lt;br /&gt;
| course&lt;br /&gt;
| completed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_completion_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_completion&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_content_deleted&#039;&#039;&#039;&lt;br /&gt;
| course_content_removed&lt;br /&gt;
| core&lt;br /&gt;
| course_content&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_created&#039;&#039;&#039;&lt;br /&gt;
| course_created&lt;br /&gt;
| core&lt;br /&gt;
| course&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_deleted&#039;&#039;&#039;&lt;br /&gt;
| course_deleted&lt;br /&gt;
| core&lt;br /&gt;
| course&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_completion_updated&#039;&#039;&#039;&lt;br /&gt;
| activity_completion_changed&lt;br /&gt;
| core&lt;br /&gt;
| course_module_completion&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_created&#039;&#039;&#039;&lt;br /&gt;
| mod_created&lt;br /&gt;
| core&lt;br /&gt;
| course_module&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_deleted&#039;&#039;&#039;&lt;br /&gt;
| mod_deleted&lt;br /&gt;
| core&lt;br /&gt;
| course_module&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_instances_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_module_instances_list&lt;br /&gt;
| viewed&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_updated&#039;&#039;&#039;&lt;br /&gt;
| mod_updated&lt;br /&gt;
| core&lt;br /&gt;
| course_module&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_reset_ended&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_reset&lt;br /&gt;
| ended&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_reset_started&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_reset&lt;br /&gt;
| started&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_restored&#039;&#039;&#039;&lt;br /&gt;
| course_restored&lt;br /&gt;
| core&lt;br /&gt;
| course&lt;br /&gt;
| restored&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_section_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| course_section&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\course_updated&#039;&#039;&#039;&lt;br /&gt;
| course_updated&lt;br /&gt;
| core&lt;br /&gt;
| course&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\email_failed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| email&lt;br /&gt;
| failed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\group_created&#039;&#039;&#039;&lt;br /&gt;
| groups_group_created&lt;br /&gt;
| core&lt;br /&gt;
| group&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\group_deleted&#039;&#039;&#039;&lt;br /&gt;
| groups_group_deleted&lt;br /&gt;
| core&lt;br /&gt;
| group&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\group_member_added&#039;&#039;&#039;&lt;br /&gt;
| groups_member_added&lt;br /&gt;
| core&lt;br /&gt;
| group_member&lt;br /&gt;
| added&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\group_member_removed&#039;&#039;&#039;&lt;br /&gt;
| groups_member_removed&lt;br /&gt;
| core&lt;br /&gt;
| group_member&lt;br /&gt;
| removed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\group_updated&#039;&#039;&#039;&lt;br /&gt;
| groups_group_updated&lt;br /&gt;
| core&lt;br /&gt;
| group&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\grouping_created&#039;&#039;&#039;&lt;br /&gt;
| groups_grouping_created&lt;br /&gt;
| core&lt;br /&gt;
| grouping&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\grouping_deleted&#039;&#039;&#039;&lt;br /&gt;
| groups_grouping_deleted&lt;br /&gt;
| core&lt;br /&gt;
| grouping&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\grouping_updated&#039;&#039;&#039;&lt;br /&gt;
| groups_grouping_updated&lt;br /&gt;
| core&lt;br /&gt;
| grouping&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\manager&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| manager&lt;br /&gt;
| anager&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\mnet_access_control_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| mnet_access_control&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\mnet_access_control_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| mnet_access_control&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\note_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| note&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\note_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| note&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\note_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| note&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\notes_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| notes&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_allow_assign_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| role_allow_assign&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_allow_override_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| role_allow_override&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_allow_switch_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| role_allow_switch&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_assigned&#039;&#039;&#039;&lt;br /&gt;
| role_assigned&lt;br /&gt;
| core&lt;br /&gt;
| role&lt;br /&gt;
| assigned&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_capabilities_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| role_capabilities&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| role&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\role_unassigned&#039;&#039;&#039;&lt;br /&gt;
| role_unassigned&lt;br /&gt;
| core&lt;br /&gt;
| role&lt;br /&gt;
| unassigned&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_created&#039;&#039;&#039;&lt;br /&gt;
| user_created&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_deleted&#039;&#039;&#039;&lt;br /&gt;
| user_deleted&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_enrolment_created&#039;&#039;&#039;&lt;br /&gt;
| user_enrolled&lt;br /&gt;
| core&lt;br /&gt;
| user_enrolment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_enrolment_deleted&#039;&#039;&#039;&lt;br /&gt;
| user_unenrolled&lt;br /&gt;
| core&lt;br /&gt;
| user_enrolment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_enrolment_updated&#039;&#039;&#039;&lt;br /&gt;
| user_enrol_modified&lt;br /&gt;
| core&lt;br /&gt;
| user_enrolment&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| user_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_loggedin&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| loggedin&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_loggedinas&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| loggedinas&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_loggedout&#039;&#039;&#039;&lt;br /&gt;
| user_logout&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| loggedout&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_login_failed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| user_login&lt;br /&gt;
| failed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_profile_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| user_profile&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\user_updated&#039;&#039;&#039;&lt;br /&gt;
| user_updated&lt;br /&gt;
| core&lt;br /&gt;
| user&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_function_called&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_function&lt;br /&gt;
| called&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_login_failed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_login&lt;br /&gt;
| failed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_service_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_service&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_service_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_service&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_service_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_service&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_service_user_added&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_service_user&lt;br /&gt;
| added&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_service_user_removed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_service_user&lt;br /&gt;
| removed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_token_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_token&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;core\event\webservice_token_sent&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| core&lt;br /&gt;
| webservice_token&lt;br /&gt;
| sent&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;logstore_legacy\event\legacy_logged&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| logstore_legacy&lt;br /&gt;
| legacy&lt;br /&gt;
| logged&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\all_submissions_downloaded&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| all_submissions&lt;br /&gt;
| downloaded&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\assessable_submitted&#039;&#039;&#039;&lt;br /&gt;
| assessable_submitted&lt;br /&gt;
| mod_assign&lt;br /&gt;
| assessable&lt;br /&gt;
| submitted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\extension_granted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| extension&lt;br /&gt;
| granted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\identities_revealed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| identities&lt;br /&gt;
| revealed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\marker_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| marker&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\statement_accepted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| statement&lt;br /&gt;
| accepted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| created&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_duplicated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| duplicated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_graded&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| graded&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_locked&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| locked&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_status_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission_status&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_unlocked&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| unlocked&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\submission_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| submission&lt;br /&gt;
| updated&lt;br /&gt;
| Abstract class &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_assign\event\workflow_state_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_assign&lt;br /&gt;
| workflow_state&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\chapter_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| chapter&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\chapter_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| chapter&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\chapter_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| chapter&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\chapter_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| chapter&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_book\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_book&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_chat\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_chat&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_chat\event\message_sent&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_chat&lt;br /&gt;
| message&lt;br /&gt;
| sent&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_chat\event\sessions_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_chat&lt;br /&gt;
| sessions&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_choice\event\answer_submitted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_choice&lt;br /&gt;
| answer&lt;br /&gt;
| submitted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_choice\event\answer_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_choice&lt;br /&gt;
| answer&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_choice\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_choice&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_choice\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_choice&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_choice\event\report_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_choice&lt;br /&gt;
| report&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\field_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| field&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\field_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| field&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\field_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| field&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\record_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| record&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\record_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| record&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\record_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| record&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\template_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| template&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_data\event\template_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_data&lt;br /&gt;
| template&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_feedback\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_feedback&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_feedback\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_feedback&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_feedback\event\response_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_feedback&lt;br /&gt;
| response&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_feedback\event\response_submitted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_feedback&lt;br /&gt;
| response&lt;br /&gt;
| submitted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_folder\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_folder&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_folder\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_folder&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_folder\event\folder_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_folder&lt;br /&gt;
| folder&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\assessable_uploaded&#039;&#039;&#039;&lt;br /&gt;
| assessable_content_uploaded&lt;br /&gt;
| mod_forum&lt;br /&gt;
| assessable&lt;br /&gt;
| uploaded&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\course_searched&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| course&lt;br /&gt;
| searched&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\discussion_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| discussion&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\discussion_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| discussion&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\discussion_moved&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| discussion&lt;br /&gt;
| moved&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\discussion_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| discussion&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\discussion_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| discussion&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\forum_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| forum&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\post_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| post&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\post_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| post&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\post_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| post&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\readtracking_disabled&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| readtracking&lt;br /&gt;
| disabled&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\readtracking_enabled&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| readtracking&lt;br /&gt;
| enabled&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\subscribers_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| subscribers&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\subscription_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| subscription&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\subscription_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| subscription&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_forum\event\userreport_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_forum&lt;br /&gt;
| userreport&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_glossary\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_glossary&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_glossary\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_glossary&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\essay_assessed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| essay&lt;br /&gt;
| assessed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\essay_attempt_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| essay_attempt&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\highscore_added&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| highscore&lt;br /&gt;
| added&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\highscores_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| highscores&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\lesson_ended&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| lesson&lt;br /&gt;
| ended&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lesson\event\lesson_started&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lesson&lt;br /&gt;
| lesson&lt;br /&gt;
| started&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lti\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lti&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lti\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_lti&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_lti\event\unknown_service_api_called&#039;&#039;&#039;&lt;br /&gt;
| lti_unknown_service_api_call&lt;br /&gt;
| mod_lti&lt;br /&gt;
| unknown_service_api&lt;br /&gt;
| called&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_page\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_page&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_page\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_page&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_quiz\event\attempt_abandoned&#039;&#039;&#039;&lt;br /&gt;
| quiz_attempt_abandoned&lt;br /&gt;
| mod_quiz&lt;br /&gt;
| attempt&lt;br /&gt;
| abandoned&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_quiz\event\attempt_becameoverdue&#039;&#039;&#039;&lt;br /&gt;
| quiz_attempt_overdue&lt;br /&gt;
| mod_quiz&lt;br /&gt;
| attempt&lt;br /&gt;
| becameoverdue&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_quiz\event\attempt_started&#039;&#039;&#039;&lt;br /&gt;
| quiz_attempt_started&lt;br /&gt;
| mod_quiz&lt;br /&gt;
| attempt&lt;br /&gt;
| started&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_quiz\event\attempt_submitted&#039;&#039;&#039;&lt;br /&gt;
| quiz_attempt_submitted&lt;br /&gt;
| mod_quiz&lt;br /&gt;
| attempt&lt;br /&gt;
| submitted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_resource\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_resource&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_resource\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_resource&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\attempt_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| attempt&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\interactions_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| interactions&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\report_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| report&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\sco_launched&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| sco&lt;br /&gt;
| launched&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\tracks_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| tracks&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_scorm\event\user_report_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_scorm&lt;br /&gt;
| user_report&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_url\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_url&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_url\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_url&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\comment_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| comment&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\comment_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| comment&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\comments_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| comments&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\course_module_instance_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| course_module_instance_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_diff_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_diff&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_history_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_history&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_locks_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_locks&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_map_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_map&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_version_deleted&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_version&lt;br /&gt;
| deleted&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_version_restored&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_version&lt;br /&gt;
| restored&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_version_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page_version&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_wiki\event\page_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_wiki&lt;br /&gt;
| page&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\assessable_uploaded&#039;&#039;&#039;&lt;br /&gt;
| assessable_content_uploaded&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| assessable&lt;br /&gt;
| uploaded&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\assessment_evaluated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| assessment&lt;br /&gt;
| evaluated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\assessment_evaluations_reset&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| assessment_evaluations&lt;br /&gt;
| reset&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\assessment_reevaluated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| assessment&lt;br /&gt;
| reevaluated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\course_module_viewed&#039;&#039;&#039;&lt;br /&gt;
| workshop_viewed&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| course_module&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\instances_list_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| instances_list&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\phase_switched&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| phase&lt;br /&gt;
| switched&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\submission_assessed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| submission&lt;br /&gt;
| assessed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\submission_created&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| submission&lt;br /&gt;
| created&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\submission_reassessed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| submission&lt;br /&gt;
| reassessed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\submission_updated&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| submission&lt;br /&gt;
| updated&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;mod_workshop\event\submission_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| mod_workshop&lt;br /&gt;
| submission&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;report_log\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| report_log&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;report_loglive\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| report_loglive&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;report_outline\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| report_outline&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;report_participation\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| report_participation&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;report_stats\event\content_viewed&#039;&#039;&#039;&lt;br /&gt;
| -&lt;br /&gt;
| report_stats&lt;br /&gt;
| content&lt;br /&gt;
| viewed&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verb list ===&lt;br /&gt;
All events must use a verb from this list. New verbs should be added to this list if required.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!verb&lt;br /&gt;
!Explanation&lt;br /&gt;
!Source&lt;br /&gt;
|-&lt;br /&gt;
|abandoned&lt;br /&gt;
|When a attempt is abandoned by user (Quiz attempt)&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|accepted&lt;br /&gt;
|Example: Accepting a statement when submitting an assignment.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|added&lt;br /&gt;
|	Used to represent &amp;quot;something that already exists is now part of/bound to another entity&amp;quot;. Examples: &amp;quot;Admin added role to user X&amp;quot;, &amp;quot;Admin added user X to group A&amp;quot;. Wrong example: &amp;quot;User added course in category&amp;quot; because it is a &#039;move&#039; action, except if a course can be part of multiple categories. The good examples work because: A user can have multiple roles, a user can be in multiple groups.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|answered&lt;br /&gt;
| Indicates the actor responded to a Question&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|assessed&lt;br /&gt;
| Some submitted material has been assessed&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|assigned&lt;br /&gt;
| Assign some privilege or role to user.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|attempted&lt;br /&gt;
| Trying to do an activity. Example: attempting a Math class.&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|awarded&lt;br /&gt;
| ex:-teacher awarded student a badge.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|backedup&lt;br /&gt;
| When a backup has been performed.&lt;br /&gt;
|Moodle	&lt;br /&gt;
|-&lt;br /&gt;
|becomeoverdue&lt;br /&gt;
| When an activity is overdue Example: Quiz attempt is overdue&lt;br /&gt;
|Moodle	&lt;br /&gt;
|-&lt;br /&gt;
|called&lt;br /&gt;
| When a call to something is made like an API @see unknown_service_api_called.php&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|commented&lt;br /&gt;
|Offered an opinion or written experience of the activity. Can be used with the learner as the actor or a system as an actor. Comments can be sent from either party with the idea that the other will read and react to the content.&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|completed&lt;br /&gt;
|To experience the activity in its entirety. Used to affirm the completion of content. This can be simply experiencing all the content, be tied to objectives or interactions, or determined in any other way. Any content that has been initialized, but not yet completed, should be considered incomplete. There is no verb to &#039;incomplete&#039; an activity, one would void the statement which completes the activity.&amp;quot;&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|created&lt;br /&gt;
|Used to represent &amp;quot;something new has been created&amp;quot;.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|Used to indicate the object in context was deleted.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|disabled&lt;br /&gt;
|When an activity is disabled. Example: forum read tracking disabled.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|downloaded&lt;br /&gt;
|When a user download file from user. Example submission/report downloaded.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|duplicated&lt;br /&gt;
|For something that has been copied.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|enabled&lt;br /&gt;
|When some setting is enabled. Example: forum read tracking enabled.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|ended&lt;br /&gt;
|When a process ends. Example: Lesson ended or course reset ended.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|evaluated&lt;br /&gt;
|Material has been evaluated.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|exported&lt;br /&gt;
|When a report is exported in certain format.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|failed&lt;br /&gt;
|Learner did not perform the activity to a level of pre-determined satisfaction. Used to affirm the lack of success a learner experienced within the learning content in relation to a threshold. If the user performed below the minimum to the level of this threshold, the content is &#039;failed&#039;. The opposite of &#039;passed&#039;. This is also used in case when message sending is failed.&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|graded&lt;br /&gt;
|Used to represent an activity was graded.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|granted&lt;br /&gt;
|User is granted some extension or capability. Example: extension granted for submission.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|imported&lt;br /&gt;
|The act of moving an object into another location or system.&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|launched&lt;br /&gt;
|When an external object is launched. Try consider started if there is related stopped event.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|locked&lt;br /&gt;
|When an activity is locked. Should have a related unlocked event.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|loggedin/loggedout&lt;br /&gt;
|	For login and logout.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|loggedinas&lt;br /&gt;
|	 If user is logged in as different user. This is used by only one event (user_loggedinas). Adding this verb makes event name more clear, then using loggedin verb.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|locked&lt;br /&gt;
|&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|moved&lt;br /&gt;
|	Used to indicate the object in context was moved.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|passed&lt;br /&gt;
|Used to affirm the success a learner experienced within the learning content in relation to a threshold. If the user performed at a minimum to the level of this threshold, the content is &#039;passed&#039;. The opposite of &#039;failed&#039;.&lt;br /&gt;
|Tincan&lt;br /&gt;
|-&lt;br /&gt;
|printed&lt;br /&gt;
|Something is printed.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|reassessed&lt;br /&gt;
|Submitted material has been assessed again.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|reevaluated&lt;br /&gt;
|Material has been evaluated again.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|removed&lt;br /&gt;
|By opposition to &amp;quot;Added&amp;quot;. This does not mean that the object has been deleted, but removed from the entity, or not bound to it any more.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|reset&lt;br /&gt;
|Sets one or more properties back to the default value.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|restored&lt;br /&gt;
|When restoring a backup. Rolling back to a previous state.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|revealed&lt;br /&gt;
|Some identity is revealed. Example: Identities revealed after blind marking.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|searched&lt;br /&gt;
|Something is searched. Example: searched in course.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|sent&lt;br /&gt;
|Message sent.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|started&lt;br /&gt;
|Some activity started&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|submitted&lt;br /&gt;
|This is very close to &amp;quot;Attempted&amp;quot;. Depends on context which one should be used. For example:- &amp;quot;Admin submitted a form. Student attempted a quiz.&amp;quot;  is correct, however some cases might not be as clear as the previous example. We can say both &amp;quot;Student submitted an assignment&amp;quot; or &amp;quot;student attempted an assignment&amp;quot;. We need to make the difference clear.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|suspended&lt;br /&gt;
| Suspend something. (example a user)&lt;br /&gt;
| Tincan (However the context is different)&lt;br /&gt;
|-&lt;br /&gt;
|switched&lt;br /&gt;
|Something has been switched. For example:- The workshop phase has been switched to assessment&amp;quot;&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|unassigned&lt;br /&gt;
|As opposed to assigned. When some role is unassigned.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|unlocked&lt;br /&gt;
|&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|upgraded&lt;br /&gt;
|Something was upgraded, some module probably&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|updated&lt;br /&gt;
|Used to indicate the object in context was updated. Simple example is &amp;quot;Admin updated course xyz&amp;quot;.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|uploaded&lt;br /&gt;
|When an assignment is uploaded.&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|viewed&lt;br /&gt;
|Something has been viewed. For example:- &amp;quot;Student viewed chapter 1 of book 1.&amp;quot;&lt;br /&gt;
|Moodle&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Rules ===&lt;br /&gt;
&lt;br /&gt;
==== Use singular ====&lt;br /&gt;
&lt;br /&gt;
Plurals must be used on objects when it&#039;s a &#039;&#039;One to Many&#039;&#039; relationship. Ex: bulk import, mass deletion, ... In any other case, use the singular.&lt;br /&gt;
&lt;br /&gt;
==== Ends with a verb ====&lt;br /&gt;
&lt;br /&gt;
The last word (after the last underscore) must be a verb.&lt;br /&gt;
&lt;br /&gt;
=== Deprecated events ===&lt;br /&gt;
Following are the events that were supported in 2.5, but deprecated in 2.6 or later&lt;br /&gt;
&lt;br /&gt;
groups_groupings_deleted (see MDL-41312)&lt;br /&gt;
&lt;br /&gt;
groups_groupings_groups_removed (see MDL-41312)&lt;br /&gt;
&lt;br /&gt;
groups_groups_deleted (see MDL-41312)&lt;br /&gt;
&lt;br /&gt;
groups_members_removed (see MDL-41312)&lt;br /&gt;
&lt;br /&gt;
== Shared events ==&lt;br /&gt;
&lt;br /&gt;
 Decision: Not supported at this stage.&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.5 we have a good example of a shared event: &#039;assessable_content_uploaded&#039; which is triggered in &#039;&#039;forum&#039;&#039;, &#039;assignment&#039;&#039; and &#039;&#039;workshop&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The problem with shared events is that we cannot easily track what component triggered them. Of course we could add a new property to the event to keep track of that, but we would soon need more information and more properties. Also, in the case of a logger, the event received would be unique, where in fact it should be considered different depending on the component firing it.&lt;br /&gt;
&lt;br /&gt;
In our first implementation, we will create one specific event per module. This flexibility does not prevent any observer from capturing them, but still makes sure that the consistency and specificity of each event is maintained.&lt;br /&gt;
&lt;br /&gt;
It could happen that some events are defined in core and shared, but this should not really happen as low-level APIs should trigger the event, and a module should call that low API instead of doing the job itself.&lt;br /&gt;
&lt;br /&gt;
== One to many ==&lt;br /&gt;
&lt;br /&gt;
 Decision: Each event should have a one to one relationship. We can reconsider this at a later stage, if the performance hit is extremely high.&lt;br /&gt;
&lt;br /&gt;
In 2.5, some events are triggered when an action happens on multiple objects. We have to decide whether we want to keep supporting &#039;&#039;One to Many&#039;&#039; events or not.&lt;br /&gt;
&lt;br /&gt;
Keeping a list of all changes for multiple actions may be problematic because you would have to keep them all in memory until all things are processed. This might also result in the order of events being incorrect. The only correct solution seems to be to trigger each item individually and then many things at the end. Performance needs to be improved elsewhere...&lt;br /&gt;
&lt;br /&gt;
=== Accuracy ===&lt;br /&gt;
&lt;br /&gt;
When uploading a bunch of users using the CSV upload feature, if only one event is triggered, it means that the observers of &#039;&#039;user_created&#039;&#039; won&#039;t be triggered. And so some functionality can be lost as, as a plugin developer, I expect this &#039;&#039;user_created&#039;&#039; to be triggered regardless of the way they have been uploaded. Of course, the developer could observe the event &#039;&#039;bulk_user_imported&#039;&#039;, but that means that he could miss some relevant observers.&lt;br /&gt;
&lt;br /&gt;
This applies to existing events.&lt;br /&gt;
&lt;br /&gt;
=== Performance ===&lt;br /&gt;
&lt;br /&gt;
Triggering one event is cheaper then repeating the same events x number of times...&lt;br /&gt;
&lt;br /&gt;
=== Information tracking ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;bulk&#039;&#039; event, might not be verbose enough to allow for proper logging afterwards. Though this is the responsibility of the logger, we probably want to make it easy to store relevant information.&lt;br /&gt;
&lt;br /&gt;
=== Double event ===&lt;br /&gt;
&lt;br /&gt;
In the case of a bulk user import, if we were to trigger an event per user created, we probably want to trigger one event &#039;user_bulk_upload_started&#039; when the action starts.&lt;br /&gt;
&lt;br /&gt;
== Unit Testing ==&lt;br /&gt;
&lt;br /&gt;
With unit testing for this system we want to assert the following:&lt;br /&gt;
&lt;br /&gt;
* That event strict validation and custom validation works.&lt;br /&gt;
* Missing event data is auto filled with accurate data.&lt;br /&gt;
* Typos in properties passed to ::create() are captured (if we decide to validate).&lt;br /&gt;
* The legacy methods return the expected values (use assertEventLegacyData() and assertEventLegacyData())&lt;br /&gt;
* The class properties are correctly overridden (crud, level, action, object, ...).&lt;br /&gt;
* The properties automatically generated (component, name, ...) are correct.&lt;br /&gt;
* Events are dispatched to the corresponding observers.&lt;br /&gt;
* Events are dispatched to the corresponding legacy handlers.&lt;br /&gt;
* Events are dispatched to the * observers.&lt;br /&gt;
* Events perform an add_to_log() if it has legacy log data.&lt;br /&gt;
* &#039;Events restore&#039; restored the whole event data, and does not miss any information.&lt;br /&gt;
* &#039;Events restore&#039; does not generate any extra information.&lt;br /&gt;
* Event methods should check context object or avoid using it, as context might not be valid at time of event restore (use assertEventContextNotUsed())&lt;br /&gt;
&lt;br /&gt;
= Example events =&lt;br /&gt;
&lt;br /&gt;
== Assignment ==&lt;br /&gt;
&lt;br /&gt;
Assumption: Course contains groups with students in each group.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.&#039;&#039;&#039; Teacher creates an assignment with group mode set to &#039;Separate groups&#039; and Feedback type set to comments and files.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has created assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;2.&#039;&#039;&#039; A student views the assignment.&lt;br /&gt;
*Event: User &#039;Student&#039; has viewed assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;3.&#039;&#039;&#039; A member from one of the groups submits an assignment&lt;br /&gt;
*Event: User &#039;Student&#039; has added a submission for assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: Email sent to the teacher and all students in that group.&lt;br /&gt;
&#039;&#039;&#039;4.&#039;&#039;&#039; User &#039;Adrian&#039; adds some changes to the assignment and updates it.&lt;br /&gt;
*Event: User &#039;Adrian&#039; has updated the submission for assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: Email sent to the teacher and all students in that group.&lt;br /&gt;
&#039;&#039;&#039;5.&#039;&#039;&#039; Teacher views the assignment.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has viewed assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;6.&#039;&#039;&#039; Teacher clicks on &#039;View/grade all submissions&#039;&lt;br /&gt;
*Event: User &#039;Teacher&#039; has viewed the assignment &#039;B&#039; grade area in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;7.&#039;&#039;&#039; Teacher clicks to grade the student&#039;s submission.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has viewed the submission for user &#039;student&#039; for assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;8.&#039;&#039;&#039; Teacher marks the assignment with the setting &#039;Apply grades and feedback to entire group&#039; set to &#039;Yes&#039; leaving a comment and a file.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has marked assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has left a comment for assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has uploaded a feedback file for assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has uploaded a file to the course &#039;C101&#039;.&lt;br /&gt;
*Event: Email sent to user &#039;Student&#039; notifying them their submission for assignment &#039;B&#039; has been marked. - This is done for all users in the group.&lt;br /&gt;
&#039;&#039;&#039;9.&#039;&#039;&#039; User &#039;Adrian&#039; views the feedback.&lt;br /&gt;
*Event: User &#039;Adrian&#039; has viewed assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;10.&#039;&#039;&#039; User &#039;Adrian&#039; opens the feedback file.&lt;br /&gt;
*Event: User &#039;Adrian&#039; has viewed the file &#039;A&#039; for assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;11.&#039;&#039;&#039; User &#039;Adrian&#039; adds some changes to the assignment insulting the teachers marking and updates it.&lt;br /&gt;
*Event: User &#039;Adrian&#039; has updated the submission for assignment &#039;B&#039; for group &#039;C&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: Email sent to user &#039;Teacher&#039; notifying them that user &#039;Adrian&#039; has updated the submission for assignment &#039;B&#039;.&lt;br /&gt;
*Event: Email sent to user &#039;Student&#039; notifying them their submission for assignment &#039;B&#039; has been updated. - This is done for all users in the group.&lt;br /&gt;
&#039;&#039;&#039;12.&#039;&#039;&#039; The teacher clicks directly on the link in the email to be taken to the grading page.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has viewed the submission for user &#039;student&#039; for assignment &#039;B&#039; in course &#039;C101&#039;.&lt;br /&gt;
&#039;&#039;&#039;13.&#039;&#039;&#039; The teacher is upset due to the harsh comments and decides to mark Adrian down, but not the rest of the group by setting &#039;Apply grades and feedback to entire group&#039; set to &#039;No&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has marked assignment &#039;B&#039; for user &#039;Adrian&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has left a comment for assignment &#039;B&#039; for user &#039;Adrian&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: User &#039;Teacher&#039; has uploaded a feedback file for assignment &#039;B&#039; for user &#039;Adrian&#039; in course &#039;C101&#039;.&lt;br /&gt;
*Event: Email sent to user &#039;Adrian&#039; notifying them their submission for assignment &#039;B&#039; has been marked.&lt;br /&gt;
&lt;br /&gt;
= FAQs =&lt;br /&gt;
&lt;br /&gt;
; Why not use create events in core subsystems? : Because we could not see all core events in one place, it would create problems when naming event classes and finally subsystems are incomplete, we would have to add more now because we could not move the events in the future.&lt;br /&gt;
&lt;br /&gt;
= Development stages =&lt;br /&gt;
&lt;br /&gt;
== Stage 1 ==&lt;br /&gt;
&lt;br /&gt;
* Finish class loader spec and implement basic Frankenstyle class loader.&lt;br /&gt;
* Describe new observer definition - just few new flags in current db/events.php&lt;br /&gt;
* Describe new event dispatcher.&lt;br /&gt;
* Describe core_event_base class.&lt;br /&gt;
* Current (= legacy) events triggering:&lt;br /&gt;
** Re-factor current event handling code to new self-contained class - do not change functionality, keep events_trigger().&lt;br /&gt;
** Create new event handler management class that deals with installation and upgrades of both legacy and new handlers.&lt;br /&gt;
* New events:&lt;br /&gt;
** Create new core_event_base class.&lt;br /&gt;
** Create new self-contained event dispatcher class with &#039;*&#039; handler support.&lt;br /&gt;
** In function core_event_base::trigger() check if the  event has property &#039;legacyeventname&#039; execute events_trigger($this-&amp;gt;legacyeventname, $this-&amp;gt;legacyeventdata) after triggering new event.&lt;br /&gt;
** Write unit tests for all new events code.&lt;br /&gt;
* No changes to be made to the current logging system yet.&lt;br /&gt;
&lt;br /&gt;
After completing this stage everything should continue to work as it did before and we can start parallel work on further stages.&lt;br /&gt;
&lt;br /&gt;
== Stage 2 (requires completion of Stage 1) ==&lt;br /&gt;
&lt;br /&gt;
* Create event classes and replace existing calls to events_trigger() and with new event classes containing legacy information properties.&lt;br /&gt;
* Add more events throughout the standard Moodle package in places where we have add_to_log(). Implement some_event::get_legacy_log_data() which returns original parameters of add_to_log() and remove it. Old add_to_log() function is called in core_event_base::trigger() automatically with original parameters.&lt;br /&gt;
* Add even more new events all over the place.&lt;br /&gt;
&lt;br /&gt;
The difficult part is defining the new event classes properly because we must not change them after the 2.6 release.&lt;br /&gt;
&lt;br /&gt;
== Stage 3 (requires partial completion of Stage 2) ==&lt;br /&gt;
&lt;br /&gt;
* Migrate current legacy event handlers to new handlers with one event class instance parameter, ex.: enrol plugins.&lt;br /&gt;
&lt;br /&gt;
== Stage 4 (requires partial completion of Stage 2) ==&lt;br /&gt;
&lt;br /&gt;
* Implement an event logging handler.&lt;br /&gt;
* Implement logging storage plugins.&lt;br /&gt;
* Define logging apis.&lt;br /&gt;
* Create new reports.&lt;br /&gt;
* Switch to new logging everywhere after Stage 2 has been completed and new reports are usable.&lt;br /&gt;
&lt;br /&gt;
See [[Logging 2]]&lt;br /&gt;
&lt;br /&gt;
== Stage 5  ==&lt;br /&gt;
&lt;br /&gt;
* Decide how much backwards compatibility we want for old log tables. Most probably they will get only legacy log data.&lt;br /&gt;
* Implement some BC solution for old code that reads log tables directly.&lt;br /&gt;
&lt;br /&gt;
See [[Logging 2]]&lt;br /&gt;
&lt;br /&gt;
== Stage 6 (requires completion of Stage 4 and 5) ==&lt;br /&gt;
&lt;br /&gt;
Moodle 2.8dev? This is the ultimate end of old logging via the &#039;&#039;log&#039;&#039; table.&lt;br /&gt;
&lt;br /&gt;
* Deprecate the add_to_log() function with a debug message and do nothing inside.&lt;br /&gt;
* Remove all legacy logging from event classes.&lt;br /&gt;
&lt;br /&gt;
See [[Logging 2]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=44005</id>
		<title>Projects for new developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=44005"/>
		<updated>2014-02-27T11:02:57Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Event subscription plugin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
[[File:GSoC2012 logo.png|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Latest news:&#039;&#039;&#039; &#039;&#039;Moodle will be taking part in the [http://socghop.appspot.com/ Google Summer of Code] for our sixth year in 2012!&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re thinking of applying to work with Moodle for GSOC 2012, please check the information on [[Applying to work with Moodle for GSOC]] and join our gsoc2012@conference.moodle.org jabber chat!&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
Moodle uses PHP, JavaScript and a number of other Web languages, so learning those is a good place to start.&lt;br /&gt;
&lt;br /&gt;
When you have some basic PHP programming skills, you may wish to start learning about how to Moodle code is organised. It is recommended that you complete the [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming] course on [http://dev.moodle.org/ dev.moodle.org]. To access this you will need to have an account on moodle.org first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking for projects suggested in the tracker, look for issues with the [https://tracker.moodle.org/issues/?jql=labels%20in%20%28addon_candidate%29 &#039;addon_candidate&#039; label].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking to make a quick contribution, look for tracker issues with marked as [https://tracker.moodle.org/issues/?jql=Difficulty%20%3D%20Easy easy].&lt;br /&gt;
&lt;br /&gt;
As you become more involved in Moodle development, you might like to learn more about the [[Coding|coding conventions]] used and how changes to Moodle core code are [[Process|processed]].&lt;br /&gt;
&lt;br /&gt;
==Potential projects==&lt;br /&gt;
&lt;br /&gt;
This evolving page lists possible Moodle projects for new developers derived from community suggestions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you have any ideas for new features in Moodle which might be suitable as projects for new developers, please see [[New feature ideas]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== SCORM ===&lt;br /&gt;
&lt;br /&gt;
There are various SCORM related projects I&#039;d be interested in mentoring for GSOC in 2014. &lt;br /&gt;
* Fix/Improve built in SCORM navigation (MDL-25642 MDL-29193 MDL-39551)&lt;br /&gt;
* Improve SCORM performance, PHPDocs, compliance with coding guidelines. - There are a number of known areas of SCORM code that need a clean-up/re-structure - It would be good to audit all the scorm code and make it comply with Moodle&#039;s coding guidelines and improve the performance of the code - it would be good to implement MUC in areas that can make use of it - Ideally we would also rewrite the datamodels/scorm_*_.js.php files to separate the php from the js and make the JavaScript cache-able - (work started on this in MDL-35870) Other related bugs: MDL-41216 MDL-41665 MDL-42314 &lt;br /&gt;
* SCORM reports - there are currently 3 SCORM reports - ideas on new report plugins would be considered as possible projects.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP, JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium -&amp;gt; Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
&lt;br /&gt;
===HTML maths editor===&lt;br /&gt;
&lt;br /&gt;
Traditional written mathematical notation takes advantage of a rich set of special symbols, together with their relative size and&lt;br /&gt;
position on a two dimensional page.   Underlying mathematical expressions is a well-defined semantic tree structure.  When typing a mathematical expression into a computer keyboard the ability to take advantage of the features of traditional mathematical notation is severely limited. Essentially one has only a one-dimensional string of symbols taken from the limited alphabet found on computer keyboards and a strict syntax. Syntax is often problematic for users.  For example, they differ between applications and they do not correspond to traditional notation. &lt;br /&gt;
&lt;br /&gt;
DragMath (http://www.dragmath.bham.ac.uk) is a nice &amp;quot;drag and drop&amp;quot; equation editor that has been integrated with the Moodle editor for some time. However, it is implemented in Java, and that is becoming increasingly problematic, with increasing security warnings on the desktop, and limited support on mobile devices. We would like a new editor, keeping all the good parts of DragMath, but written in JavaScript. This could then be integrated with Moodle and other web applications.&lt;br /&gt;
&lt;br /&gt;
Goal: to create a useful and usable &amp;quot;mathematics entry system&amp;quot; for Moodle, using a combination of JavaScript and HTML5.&lt;br /&gt;
&lt;br /&gt;
This should&lt;br /&gt;
* parse typed expressions into an internal tree representation&lt;br /&gt;
* provide useful feedback to users, e.g. &amp;quot;missing bracket&amp;quot;, on ill-formed expressions.&lt;br /&gt;
* have flexible options for providing a &amp;quot;context&amp;quot; to mediate between the requirements of a strict syntax, and users&#039; expectations based on traditional written mathematics.  E.g. is &amp;quot;x(t+1)&amp;quot; a multiplication of x and (t+1) or application of the function &amp;quot;x&amp;quot; to the argument &amp;quot;(t+1)&amp;quot;?&lt;br /&gt;
* have &amp;quot;drag and drop&amp;quot; components (in HTML5)&lt;br /&gt;
* have a modular and flexible output mechanism, this includes&lt;br /&gt;
** on-screen display &amp;quot;as you type/edit&amp;quot; &lt;br /&gt;
** output in a variety of formats, LaTeX, Maxima syntax, MathML etc. which can be embedded into web applications, specifically Moodle.  It is not a goal to provide multiple outputs, but it is a goal to develop a framework in which other users can contribute such formats.&lt;br /&gt;
** show users the internal tree representation on request&lt;br /&gt;
* potentially enable manipulation (computer algebra) of internal expressions by pre-defined rules.&lt;br /&gt;
* have a well documented and simple API.&lt;br /&gt;
&lt;br /&gt;
Much of the basic design has been done in for example&lt;br /&gt;
* DragMath   http://www.dragmath.bham.ac.uk/&lt;br /&gt;
* Numbas     http://www.ncl.ac.uk/maths/numbas/&lt;br /&gt;
* CanvasMath https://code.google.com/p/canvasmath/&lt;br /&gt;
We will draw from this previous design experience to guide the development.&lt;br /&gt;
&lt;br /&gt;
See this forum thread: https://moodle.org/mod/forum/discuss.php?d=251627 for more.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: JavaScript, HTML 5&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Chris Sangwin&lt;br /&gt;
&lt;br /&gt;
===New question types===&lt;br /&gt;
&lt;br /&gt;
This is not really a specific project idea, but I would like to point one an important general area:&lt;br /&gt;
&lt;br /&gt;
With HTML5 the range of what can be done in a web browser keeps expanding. Can we use these possibilities to make new, much more interactive, question types for Moodle? &lt;br /&gt;
&lt;br /&gt;
There are some ideas in this forum thread: https://moodle.org/mod/forum/discuss.php?d=222439&lt;br /&gt;
* a question type where students have to join things up correctly by adding lines to a diagram (for example to complete an electric circuit).&lt;br /&gt;
* a question type where students can change the colour of certain parts of a diagram, and they have to get it correct.&lt;br /&gt;
* ... I am sure there are more possible ideas. Use your imagination!&lt;br /&gt;
&lt;br /&gt;
There are also some ideas which don&#039;t require complex HTML5 things:&lt;br /&gt;
* A &#039;Give 3 examples of ...&#039; Question type. For example &amp;quot;Give three ways to speed up a chemical reaction:&amp;quot;. Answer &#039;heat&#039;, &#039;increase concentration&#039;, &#039;catalyst&#039; (in any order). However, &#039;warm it&#039; might be an acceptable alternative, but &#039;heat&#039;, &#039;catalyst&#039;, &#039;warm it&#039; should only score 2/3.&lt;br /&gt;
* An ordering question type. Probably based on the OU&#039;s qtype_ddwtos. The think that cannot do is give good credit for partially correct answer. For example &#039;F&#039;, &#039;A&#039;, &#039;B&#039;, &#039;C&#039;, &#039;D&#039;, &#039;E&#039; might be considered close to the right order, but if you do that with ddwtos it will score 0.&lt;br /&gt;
* A question type where students must highlight certain words in some text. E.g. &amp;quot;Find all the verbs in this paragraph.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is also scope to make significant enhancements to existing question types. For example&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_ddmarker Drag and drop markers] allow teachers to define the drop zones by dragging with the mouse, rather than typing co-ordinates.&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_pmatch the pattern-match question type] a tool like STACK question tests to help teachers verify that their answer matching works correctly (upload example responses, indicate what grade they should receive, show what grade they actually receive, and highlight the differences.&lt;br /&gt;
&lt;br /&gt;
Before proposing anything, please make sure you are familiar with the [https://docs.moodle.org/22/en/Questions standard question types] already available in Moodle, and the [http://moodle.org/plugins/browse.php?list=category&amp;amp;id=29 contributed question types] that other people have already created.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP &amp;amp; JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium - Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Tim Hunt&lt;br /&gt;
&lt;br /&gt;
=== Plagiarism plugin ===&lt;br /&gt;
&lt;br /&gt;
There are various commercial plugins available that use the Plagiarism API in Moodle, but because these plagiarism systems can require paid subscriptions, testing them can be difficult. I&#039;d like to see a basic plugin developed that could be used for testing the Plagiarism API, providing simple useful functionality. All Plagiarism API functions for all Modules that support the API should be implemented and used. It could check the file contenthash against all other files uploaded in the Moodle files table and if a matching record is found it should display information about the duplicate submission including if the same student has submitted the file in a different course/activity or if a different user has uploaded the file with the same contenthash.&lt;br /&gt;
&lt;br /&gt;
The first stage of this project is to implement very simple high performing code that allows easy testing of the Plagiarism API and provide some very basic functionality by checking the contenthash &lt;br /&gt;
This code should implement unit tests and behat tests so that we can verify that the Moodle Plagiarism API is functioning correctly.&lt;br /&gt;
&lt;br /&gt;
The long term plan (possibly after GSOC) would be to get this plugin to post content to an external source which could implement a more complete plagiarism check running on a separate server so it doesn&#039;t affect performance of the Moodle site. The Plagiarism plugin &amp;quot;Crot&amp;quot; may have some code that could be repurposed to use for this.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Discussion&#039;&#039;&#039;: [http://dev.moodle.org/mod/forum/discuss.php?d=1822]&lt;br /&gt;
&lt;br /&gt;
=== Event subscription plugin ===&lt;br /&gt;
	 &lt;br /&gt;
This project includes the following:-&lt;br /&gt;
* creating a Moodle plugin that provides users with an interface to subscribe to various events in Moodle.&lt;br /&gt;
* Users should be able to subscribe to generic events (ex:- all delete events) or extremelly specfic events (ex:- users added to a specific group)&lt;br /&gt;
* Performance is an important aspect, any solution designed should not be too harsh on performance.&lt;br /&gt;
* This project requires deep understanding of Moodle events framework - [https://docs.moodle.org/dev/Event_2 Event Specs]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP and Javascript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1310725, Ankit Agarwal]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC]] - describing Moodle&#039;s involvement with Google in their Summer of Code program&lt;br /&gt;
* [http://tracker.moodle.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=type+in+%28%22New+Feature%22%2C+Improvement%29+AND+resolution+%3D+unresolved+ORDER+BY+votes+DESC&amp;amp;runQuery=true&amp;amp;clear=true Popular new feature and improvement requests in Tracker]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=44004</id>
		<title>Projects for new developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=44004"/>
		<updated>2014-02-27T11:02:11Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Event subscription plugin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
[[File:GSoC2012 logo.png|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Latest news:&#039;&#039;&#039; &#039;&#039;Moodle will be taking part in the [http://socghop.appspot.com/ Google Summer of Code] for our sixth year in 2012!&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re thinking of applying to work with Moodle for GSOC 2012, please check the information on [[Applying to work with Moodle for GSOC]] and join our gsoc2012@conference.moodle.org jabber chat!&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
Moodle uses PHP, JavaScript and a number of other Web languages, so learning those is a good place to start.&lt;br /&gt;
&lt;br /&gt;
When you have some basic PHP programming skills, you may wish to start learning about how to Moodle code is organised. It is recommended that you complete the [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming] course on [http://dev.moodle.org/ dev.moodle.org]. To access this you will need to have an account on moodle.org first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking for projects suggested in the tracker, look for issues with the [https://tracker.moodle.org/issues/?jql=labels%20in%20%28addon_candidate%29 &#039;addon_candidate&#039; label].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking to make a quick contribution, look for tracker issues with marked as [https://tracker.moodle.org/issues/?jql=Difficulty%20%3D%20Easy easy].&lt;br /&gt;
&lt;br /&gt;
As you become more involved in Moodle development, you might like to learn more about the [[Coding|coding conventions]] used and how changes to Moodle core code are [[Process|processed]].&lt;br /&gt;
&lt;br /&gt;
==Potential projects==&lt;br /&gt;
&lt;br /&gt;
This evolving page lists possible Moodle projects for new developers derived from community suggestions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you have any ideas for new features in Moodle which might be suitable as projects for new developers, please see [[New feature ideas]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== SCORM ===&lt;br /&gt;
&lt;br /&gt;
There are various SCORM related projects I&#039;d be interested in mentoring for GSOC in 2014. &lt;br /&gt;
* Fix/Improve built in SCORM navigation (MDL-25642 MDL-29193 MDL-39551)&lt;br /&gt;
* Improve SCORM performance, PHPDocs, compliance with coding guidelines. - There are a number of known areas of SCORM code that need a clean-up/re-structure - It would be good to audit all the scorm code and make it comply with Moodle&#039;s coding guidelines and improve the performance of the code - it would be good to implement MUC in areas that can make use of it - Ideally we would also rewrite the datamodels/scorm_*_.js.php files to separate the php from the js and make the JavaScript cache-able - (work started on this in MDL-35870) Other related bugs: MDL-41216 MDL-41665 MDL-42314 &lt;br /&gt;
* SCORM reports - there are currently 3 SCORM reports - ideas on new report plugins would be considered as possible projects.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP, JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium -&amp;gt; Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
&lt;br /&gt;
===HTML maths editor===&lt;br /&gt;
&lt;br /&gt;
Traditional written mathematical notation takes advantage of a rich set of special symbols, together with their relative size and&lt;br /&gt;
position on a two dimensional page.   Underlying mathematical expressions is a well-defined semantic tree structure.  When typing a mathematical expression into a computer keyboard the ability to take advantage of the features of traditional mathematical notation is severely limited. Essentially one has only a one-dimensional string of symbols taken from the limited alphabet found on computer keyboards and a strict syntax. Syntax is often problematic for users.  For example, they differ between applications and they do not correspond to traditional notation. &lt;br /&gt;
&lt;br /&gt;
DragMath (http://www.dragmath.bham.ac.uk) is a nice &amp;quot;drag and drop&amp;quot; equation editor that has been integrated with the Moodle editor for some time. However, it is implemented in Java, and that is becoming increasingly problematic, with increasing security warnings on the desktop, and limited support on mobile devices. We would like a new editor, keeping all the good parts of DragMath, but written in JavaScript. This could then be integrated with Moodle and other web applications.&lt;br /&gt;
&lt;br /&gt;
Goal: to create a useful and usable &amp;quot;mathematics entry system&amp;quot; for Moodle, using a combination of JavaScript and HTML5.&lt;br /&gt;
&lt;br /&gt;
This should&lt;br /&gt;
* parse typed expressions into an internal tree representation&lt;br /&gt;
* provide useful feedback to users, e.g. &amp;quot;missing bracket&amp;quot;, on ill-formed expressions.&lt;br /&gt;
* have flexible options for providing a &amp;quot;context&amp;quot; to mediate between the requirements of a strict syntax, and users&#039; expectations based on traditional written mathematics.  E.g. is &amp;quot;x(t+1)&amp;quot; a multiplication of x and (t+1) or application of the function &amp;quot;x&amp;quot; to the argument &amp;quot;(t+1)&amp;quot;?&lt;br /&gt;
* have &amp;quot;drag and drop&amp;quot; components (in HTML5)&lt;br /&gt;
* have a modular and flexible output mechanism, this includes&lt;br /&gt;
** on-screen display &amp;quot;as you type/edit&amp;quot; &lt;br /&gt;
** output in a variety of formats, LaTeX, Maxima syntax, MathML etc. which can be embedded into web applications, specifically Moodle.  It is not a goal to provide multiple outputs, but it is a goal to develop a framework in which other users can contribute such formats.&lt;br /&gt;
** show users the internal tree representation on request&lt;br /&gt;
* potentially enable manipulation (computer algebra) of internal expressions by pre-defined rules.&lt;br /&gt;
* have a well documented and simple API.&lt;br /&gt;
&lt;br /&gt;
Much of the basic design has been done in for example&lt;br /&gt;
* DragMath   http://www.dragmath.bham.ac.uk/&lt;br /&gt;
* Numbas     http://www.ncl.ac.uk/maths/numbas/&lt;br /&gt;
* CanvasMath https://code.google.com/p/canvasmath/&lt;br /&gt;
We will draw from this previous design experience to guide the development.&lt;br /&gt;
&lt;br /&gt;
See this forum thread: https://moodle.org/mod/forum/discuss.php?d=251627 for more.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: JavaScript, HTML 5&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Chris Sangwin&lt;br /&gt;
&lt;br /&gt;
===New question types===&lt;br /&gt;
&lt;br /&gt;
This is not really a specific project idea, but I would like to point one an important general area:&lt;br /&gt;
&lt;br /&gt;
With HTML5 the range of what can be done in a web browser keeps expanding. Can we use these possibilities to make new, much more interactive, question types for Moodle? &lt;br /&gt;
&lt;br /&gt;
There are some ideas in this forum thread: https://moodle.org/mod/forum/discuss.php?d=222439&lt;br /&gt;
* a question type where students have to join things up correctly by adding lines to a diagram (for example to complete an electric circuit).&lt;br /&gt;
* a question type where students can change the colour of certain parts of a diagram, and they have to get it correct.&lt;br /&gt;
* ... I am sure there are more possible ideas. Use your imagination!&lt;br /&gt;
&lt;br /&gt;
There are also some ideas which don&#039;t require complex HTML5 things:&lt;br /&gt;
* A &#039;Give 3 examples of ...&#039; Question type. For example &amp;quot;Give three ways to speed up a chemical reaction:&amp;quot;. Answer &#039;heat&#039;, &#039;increase concentration&#039;, &#039;catalyst&#039; (in any order). However, &#039;warm it&#039; might be an acceptable alternative, but &#039;heat&#039;, &#039;catalyst&#039;, &#039;warm it&#039; should only score 2/3.&lt;br /&gt;
* An ordering question type. Probably based on the OU&#039;s qtype_ddwtos. The think that cannot do is give good credit for partially correct answer. For example &#039;F&#039;, &#039;A&#039;, &#039;B&#039;, &#039;C&#039;, &#039;D&#039;, &#039;E&#039; might be considered close to the right order, but if you do that with ddwtos it will score 0.&lt;br /&gt;
* A question type where students must highlight certain words in some text. E.g. &amp;quot;Find all the verbs in this paragraph.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is also scope to make significant enhancements to existing question types. For example&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_ddmarker Drag and drop markers] allow teachers to define the drop zones by dragging with the mouse, rather than typing co-ordinates.&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_pmatch the pattern-match question type] a tool like STACK question tests to help teachers verify that their answer matching works correctly (upload example responses, indicate what grade they should receive, show what grade they actually receive, and highlight the differences.&lt;br /&gt;
&lt;br /&gt;
Before proposing anything, please make sure you are familiar with the [https://docs.moodle.org/22/en/Questions standard question types] already available in Moodle, and the [http://moodle.org/plugins/browse.php?list=category&amp;amp;id=29 contributed question types] that other people have already created.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP &amp;amp; JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium - Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Tim Hunt&lt;br /&gt;
&lt;br /&gt;
=== Plagiarism plugin ===&lt;br /&gt;
&lt;br /&gt;
There are various commercial plugins available that use the Plagiarism API in Moodle, but because these plagiarism systems can require paid subscriptions, testing them can be difficult. I&#039;d like to see a basic plugin developed that could be used for testing the Plagiarism API, providing simple useful functionality. All Plagiarism API functions for all Modules that support the API should be implemented and used. It could check the file contenthash against all other files uploaded in the Moodle files table and if a matching record is found it should display information about the duplicate submission including if the same student has submitted the file in a different course/activity or if a different user has uploaded the file with the same contenthash.&lt;br /&gt;
&lt;br /&gt;
The first stage of this project is to implement very simple high performing code that allows easy testing of the Plagiarism API and provide some very basic functionality by checking the contenthash &lt;br /&gt;
This code should implement unit tests and behat tests so that we can verify that the Moodle Plagiarism API is functioning correctly.&lt;br /&gt;
&lt;br /&gt;
The long term plan (possibly after GSOC) would be to get this plugin to post content to an external source which could implement a more complete plagiarism check running on a separate server so it doesn&#039;t affect performance of the Moodle site. The Plagiarism plugin &amp;quot;Crot&amp;quot; may have some code that could be repurposed to use for this.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Discussion&#039;&#039;&#039;: [http://dev.moodle.org/mod/forum/discuss.php?d=1822]&lt;br /&gt;
&lt;br /&gt;
=== Event subscription plugin ===&lt;br /&gt;
	 &lt;br /&gt;
This project includes the following:-&lt;br /&gt;
* creating a Moodle plugin that provides users with an interface to subscribe to various events in Moodle.&lt;br /&gt;
* Users should be able to subscribe to generic events (ex:- all delete events) or extremelly specfic events (ex:- users added to a specific group)&lt;br /&gt;
* Performance is an important aspect, any solution designed should not be too harsh on performance.&lt;br /&gt;
* This project requires deep understanding of Moodle events framework - [https://docs.moodle.org/dev/Event_2, Event Specs]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP and Javascript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1310725, Ankit Agarwal]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC]] - describing Moodle&#039;s involvement with Google in their Summer of Code program&lt;br /&gt;
* [http://tracker.moodle.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=type+in+%28%22New+Feature%22%2C+Improvement%29+AND+resolution+%3D+unresolved+ORDER+BY+votes+DESC&amp;amp;runQuery=true&amp;amp;clear=true Popular new feature and improvement requests in Tracker]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42344</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42344"/>
		<updated>2013-09-19T13:21:18Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* works consistently on different DB engines and different content languages( Non latin languages support)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance( Score )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case insensitive search capability&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  * Hyper Text Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * Open Document Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Autocomplete ( autosuggest with non-latin languages too )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Very fast than existing course search implementation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Spell Checking capability ( Did you mean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Keyword Matching (Searching within specific field)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Example :- &amp;quot;summary:Getting started with python&amp;quot; searches for the &amp;quot;Getting started with python&amp;quot; in summary field of courses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Proximity Search&lt;br /&gt;
&lt;br /&gt;
    Example :- &amp;quot;moodle perth&amp;quot;~4 Search for &amp;quot;moodle perth&amp;quot; within 4 words from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Wildcard Search&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fuzzy search support ( Alternate form of words )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Filtering results by startdate (Range queries)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Pagination &amp;amp; sorting results by relevance, startdate, shortname.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisite ===&lt;br /&gt;
&lt;br /&gt;
Java 5 or higher (a.k.a. 1.5.x), PHP 5.1.4 or higher, moodle 2.5 or higher.&lt;br /&gt;
&lt;br /&gt;
=== Installing admin tool ===&lt;br /&gt;
&lt;br /&gt;
1. Download the admin tool from here. (https://moodle.org/plugins/view.php?plugin=tool_coursesearch) &lt;br /&gt;
&lt;br /&gt;
2. Extract the Course Search folder. Put it under moodle installation/admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
3. It should be named coursesearch. If you are already logged in just refreshing the browser should trigger your moodle &lt;br /&gt;
site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
4. If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme OR replacing/copying the renderer.php file ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is two options either you may replace/copy your existing theme renderer with the one found in&lt;br /&gt;
search_cleantheme(https://github.com/shashirepo/moodle-theme_cleantheme).&lt;br /&gt;
OR you may install cleantheme itself.&lt;br /&gt;
&lt;br /&gt;
replacing /copying the renderer file to your theme.&lt;br /&gt;
&lt;br /&gt;
1. Copy renderer.php file from search_cleantheme replace it with your theme&#039;s renderer file.&lt;br /&gt;
&lt;br /&gt;
2. Standard moodle theme doesn&#039;t have any renderer file so you may simply copy this to your&lt;br /&gt;
theme directory.&lt;br /&gt;
&lt;br /&gt;
3. Rename renderer class name according to your theme name.&lt;br /&gt;
&lt;br /&gt;
for example if you are using theme &#039;clean&#039;.&lt;br /&gt;
then rename the class names to &#039;theme_clean_core_renderer&#039; &amp;amp; &#039;theme_clean_core_course_renderer&#039;.&lt;br /&gt;
&lt;br /&gt;
OR you may either use search_cleantheme. This is based on bootstrap clean theme.&lt;br /&gt;
&lt;br /&gt;
1. Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme) &lt;br /&gt;
&lt;br /&gt;
2. Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
3. If you are already logged in just refreshing the browser should trigger your Moodle&lt;br /&gt;
site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
4. If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from:&lt;br /&gt;
http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot&lt;br /&gt;
and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for&lt;br /&gt;
testing, development, and even for smaller production sites. This&lt;br /&gt;
application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to&lt;br /&gt;
something like schema.bak. Then move the schema.xml that comes &lt;br /&gt;
with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename&lt;br /&gt;
it like solrconfig.bak. Then move the solrconfig.xml that comes with the&lt;br /&gt;
moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename&lt;br /&gt;
it like protwords.bak. Then move the protwords.txt that comes with the&lt;br /&gt;
moodle course search admin tool plugin  to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core&lt;br /&gt;
may not load if you don&#039;t have at least an empty file present:&lt;br /&gt;
solrconfig.xml&lt;br /&gt;
schema.xml&lt;br /&gt;
elevate.xml&lt;br /&gt;
mapping-ISOLatin1Accent.txt&lt;br /&gt;
protwords.txt&lt;br /&gt;
stopwords.txt&lt;br /&gt;
synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to&lt;br /&gt;
apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
Test that your solr server is now available by visiting&lt;br /&gt;
http://localhost:8983/solr/admin/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing with ping to solr ===&lt;br /&gt;
&lt;br /&gt;
1. Advance Course can be found under :-&lt;br /&gt;
&lt;br /&gt;
Administration-&amp;gt;course-&amp;gt;Course search settings(URL:- http://127.0.0.1/MoodleInstalltionURL/admin/tool/coursesearch)&lt;br /&gt;
&lt;br /&gt;
2. Give the solr configuration options here:-&lt;br /&gt;
&lt;br /&gt;
Solr Host:- localhost or 127.0.0.1&lt;br /&gt;
Solr Port:- 8983 (Default port for Solr )&lt;br /&gt;
Solr path :- /solr (Configuration directory for solr)&lt;br /&gt;
&lt;br /&gt;
3. Click on &amp;quot;Check Solr instance Setting&amp;quot;. if it Shows ping successful(with an success image). Now click save changes.&lt;br /&gt;
&lt;br /&gt;
4. Now click on &amp;quot;Index courses&amp;quot; to index all the courses. After successful indexing. It will come up with a success image.&lt;br /&gt;
&lt;br /&gt;
5. Click on &amp;quot;Optimize&amp;quot; to optimize the existing indexes And improve solr performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy the Search by going on page (http://127.0.0.1/MoodleInstallationURL/course/search.php)&lt;br /&gt;
&lt;br /&gt;
To configure navigation with the course search page goto Site administration -&amp;gt; Front page -&amp;gt; Front page settings.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42343</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42343"/>
		<updated>2013-09-19T13:20:00Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* works consistently on different DB engines and different content languages( Non latin languages support)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance( Score )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case insensitive search capability&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  * Hyper Text Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * Open Document Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Autocomplete ( autosuggest with non-latin languages too )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Very fast than existing course search implementation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Spell Checking capability ( Did you mean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Keyword Matching (Searching within specific field)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Example :- &amp;quot;summary:Getting started with python&amp;quot; searches for the &amp;quot;Getting started with python&amp;quot; in summary field of courses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Proximity Search&lt;br /&gt;
&lt;br /&gt;
    Example :- &amp;quot;moodle perth&amp;quot;~4 Search for &amp;quot;moodle perth&amp;quot; within 4 words from each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Wildcard Search&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fuzzy search support ( Alternate form of words )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Filtering results by startdate (Range queries)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Pagination &amp;amp; sorting results by relevance, startdate, shortname.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42242</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42242"/>
		<updated>2013-08-29T06:34:36Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42241</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42241"/>
		<updated>2013-08-29T06:33:31Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42240</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42240"/>
		<updated>2013-08-29T06:32:33Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42239</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42239"/>
		<updated>2013-08-29T06:31:05Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|700px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42238</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42238"/>
		<updated>2013-08-29T06:29:49Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42237</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42237"/>
		<updated>2013-08-29T06:29:14Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42236</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42236"/>
		<updated>2013-08-29T06:28:13Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42235</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42235"/>
		<updated>2013-08-29T06:27:32Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42234</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42234"/>
		<updated>2013-08-29T06:25:40Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42233</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=42233"/>
		<updated>2013-08-29T06:24:16Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Advance course search auto-suggestions&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:autocomplete.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=File:autocomplete.png&amp;diff=42232</id>
		<title>File:autocomplete.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=File:autocomplete.png&amp;diff=42232"/>
		<updated>2013-08-29T06:21:00Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: Moodle advance course search plugin autocomplete feature.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle advance course search plugin autocomplete feature.&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41874</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41874"/>
		<updated>2013-08-11T18:04:00Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41873</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41873"/>
		<updated>2013-08-11T17:56:19Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Require moodle 2.5 and Apache solr 4.x&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41872</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41872"/>
		<updated>2013-08-11T17:31:55Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   *  Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41849</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41849"/>
		<updated>2013-08-08T19:14:33Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41848</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41848"/>
		<updated>2013-08-08T19:13:54Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41847</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41847"/>
		<updated>2013-08-08T19:13:09Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41846</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41846"/>
		<updated>2013-08-08T19:12:30Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41845</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41845"/>
		<updated>2013-08-08T19:11:16Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41844</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41844"/>
		<updated>2013-08-08T19:10:26Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41843</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41843"/>
		<updated>2013-08-08T19:09:17Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png|1000px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41842</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41842"/>
		<updated>2013-08-08T19:00:46Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Installing Solr &amp;amp; placing the plugin Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: &lt;br /&gt;
* solrconfig.xml &lt;br /&gt;
* schema.xml&lt;br /&gt;
* elevate.xml&lt;br /&gt;
* mapping-ISOLatin1Accent.txt&lt;br /&gt;
* protwords.txt&lt;br /&gt;
* stopwords.txt&lt;br /&gt;
* synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41841</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41841"/>
		<updated>2013-08-08T18:57:57Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_Search_IntraWordQuery.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=File:Course_Search_IntraWordQuery.png&amp;diff=41840</id>
		<title>File:Course Search IntraWordQuery.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=File:Course_Search_IntraWordQuery.png&amp;diff=41840"/>
		<updated>2013-08-08T18:56:44Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: plugin Course search Results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;plugin Course search Results&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41839</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41839"/>
		<updated>2013-08-08T18:55:06Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course search plugin snapshots:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search admin tool&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Course search results&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Course_search_Adminui.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=File:Course_search_Adminui.png&amp;diff=41838</id>
		<title>File:Course search Adminui.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=File:Course_search_Adminui.png&amp;diff=41838"/>
		<updated>2013-08-08T18:52:05Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: Course Search plugin Admin UI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Course Search plugin Admin UI&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41837</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41837"/>
		<updated>2013-08-08T18:48:20Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non Latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
* Search results with relevance(Score)&lt;br /&gt;
&lt;br /&gt;
* Searchable Document Formats&lt;br /&gt;
&lt;br /&gt;
  * HyperText Markup Language&lt;br /&gt;
  * XML and derived formats&lt;br /&gt;
  * Microsoft Office document formats&lt;br /&gt;
  * OpenDocument Format&lt;br /&gt;
  * Portable Document Format &lt;br /&gt;
  * Rich Text Format&lt;br /&gt;
  * Compression and packaging formats [See Rebuilding Solr Cell]&lt;br /&gt;
  * Text formats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
   * Sorting results by score, by shortname, by startdate&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41836</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41836"/>
		<updated>2013-08-08T18:44:08Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Installing Solr &amp;amp; placing the plugin Schema = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ===&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41835</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41835"/>
		<updated>2013-08-08T18:43:24Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Setting up Advance course search is quite easy ! you just need to go thorough these steps.&lt;br /&gt;
&lt;br /&gt;
=== Installing Admin tool ===&lt;br /&gt;
&lt;br /&gt;
* Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)&lt;br /&gt;
&lt;br /&gt;
* Extract the Course Search folder. and put it under moodle installation /admin/tool directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
=== Installing search_cleantheme ===&lt;br /&gt;
&lt;br /&gt;
* Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)&lt;br /&gt;
&lt;br /&gt;
* Extract the theme folder. and put it under moodle installation theme directory.&lt;br /&gt;
&lt;br /&gt;
* If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;.&lt;br /&gt;
&lt;br /&gt;
* If not then navigate to Administration &amp;gt; Notifications. &lt;br /&gt;
&lt;br /&gt;
===  Installing Solr &amp;amp; placing the plugin Schema ====&lt;br /&gt;
&lt;br /&gt;
Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/&lt;br /&gt;
&lt;br /&gt;
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).&lt;br /&gt;
&lt;br /&gt;
The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.&lt;br /&gt;
&lt;br /&gt;
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.&lt;br /&gt;
&lt;br /&gt;
Make sure that the conf directory includes the following files - the Solr core may not load if you don&#039;t have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt&lt;br /&gt;
&lt;br /&gt;
Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41434</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=41434"/>
		<updated>2013-07-18T20:51:39Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=232803 Course Search plugin Progress]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40989</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40989"/>
		<updated>2013-06-19T09:39:47Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.5.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40880</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40880"/>
		<updated>2013-06-12T08:54:32Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=230469 Writing Moodle&#039;s Course Search plugin]&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40829</id>
		<title>GSOC/2013</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40829"/>
		<updated>2013-06-09T18:11:14Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Course search */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:banner-gsoc2013.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
[[GSOC|GSoC]] &amp;gt; GSoC 2013&lt;br /&gt;
&lt;br /&gt;
An overview of the [http://www.google-melange.com/gsoc/program/home/google/gsoc2013 Google Summer of Code 2013] projects for Moodle..&lt;br /&gt;
&lt;br /&gt;
==Self-assessment activity using the question bank==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1580475&amp;amp;course=5 Jayesh Anandani]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=8026&amp;amp;course=5 Jean-Michel Vedrine] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Self-assessment activity using the question bank]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4334&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==SCORM player rewrite==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1277285&amp;amp;course=5 Mayank Gupta]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[SCORM player rewrite]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-39910&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Global search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1565904&amp;amp;course=5 Prateek Sachan]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=353008&amp;amp;course=5 Tomasz Muras] &amp;amp; [https://moodle.org/user/view.php?id=1146834&amp;amp;course=5 Aparup Banerjee] &lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Global search]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-31989&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Course search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Course search]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4335&lt;br /&gt;
* Developer blog [http://shashitechno.wordpress.com/ # Shashikant Vaishnav]&lt;br /&gt;
&lt;br /&gt;
==Pronunciation evaluation question type==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1594272 Troy Lee]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1081865&amp;amp;course=5 James Salsman] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Pronunciation evaluation question type]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4336&lt;br /&gt;
* [http://pronunciationeval.blogspot.sg/ Developer blog]&lt;br /&gt;
&lt;br /&gt;
==BioAuth: A Moodle plugin for determining Quiz authorship==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1595676 Vinnie Monaco]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[BioAuth Plugin]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4337&lt;br /&gt;
* [http://vmonaco.com/blog Developer blog]&lt;br /&gt;
&lt;br /&gt;
==Portfolio plugin for Evernote==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1459982 Vishal Raheja]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1451616 Frédéric Massart] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Portfolio plugin for Evernote]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4338&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40828</id>
		<title>GSOC/2013</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40828"/>
		<updated>2013-06-09T18:10:40Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Course search */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:banner-gsoc2013.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
[[GSOC|GSoC]] &amp;gt; GSoC 2013&lt;br /&gt;
&lt;br /&gt;
An overview of the [http://www.google-melange.com/gsoc/program/home/google/gsoc2013 Google Summer of Code 2013] projects for Moodle..&lt;br /&gt;
&lt;br /&gt;
==Self-assessment activity using the question bank==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1580475&amp;amp;course=5 Jayesh Anandani]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=8026&amp;amp;course=5 Jean-Michel Vedrine] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Self-assessment activity using the question bank]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4334&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==SCORM player rewrite==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1277285&amp;amp;course=5 Mayank Gupta]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[SCORM player rewrite]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-39910&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Global search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1565904&amp;amp;course=5 Prateek Sachan]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=353008&amp;amp;course=5 Tomasz Muras] &amp;amp; [https://moodle.org/user/view.php?id=1146834&amp;amp;course=5 Aparup Banerjee] &lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Global search]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-31989&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Course search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Course search]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4335&lt;br /&gt;
* Developer blog [http://shashitechno.wordpress.com/ #Shashikant Vaishnav]&lt;br /&gt;
&lt;br /&gt;
==Pronunciation evaluation question type==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1594272 Troy Lee]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1081865&amp;amp;course=5 James Salsman] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Pronunciation evaluation question type]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4336&lt;br /&gt;
* [http://pronunciationeval.blogspot.sg/ Developer blog]&lt;br /&gt;
&lt;br /&gt;
==BioAuth: A Moodle plugin for determining Quiz authorship==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1595676 Vinnie Monaco]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[BioAuth Plugin]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4337&lt;br /&gt;
* [http://vmonaco.com/blog Developer blog]&lt;br /&gt;
&lt;br /&gt;
==Portfolio plugin for Evernote==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1459982 Vishal Raheja]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1451616 Frédéric Massart] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Portfolio plugin for Evernote]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4338&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40827</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40827"/>
		<updated>2013-06-09T17:45:52Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Earlier we had two choices for this purpose - Apache Solr and Sphinx. Both Apache solr and Sphinx has extensive documentation and community support and have very powerful indexing capabilities, but eventually faceted search and fuzzy search features that works out of the box with some other key points explained below for Apache Solr made it the winning solution.&lt;br /&gt;
&lt;br /&gt;
=== Why Apache Solr ===&lt;br /&gt;
&lt;br /&gt;
*  As in Courses we are going to deal with Different types of summary documents &amp;amp; Solr can index proprietary formats like Microsoft Word, Pdf, etc. Sphinx can&#039;t.&lt;br /&gt;
&lt;br /&gt;
*  Solr supports field collapsing to avoid duplicating similar results. Sphinx doesn&#039;t seem to provide any feature like this.&lt;br /&gt;
&lt;br /&gt;
*  As we were concerned about the non-latin character support, Solr supports unicode character search out of the box.&lt;br /&gt;
&lt;br /&gt;
*  Solr, being an Apache project, is obviously Apache2-licensed. So the real challenge is now to integrate Apache Solr with moodle course search functionality. Advance course search will be installed as a plugin to substitute basic core search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Roadmap ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40826</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40826"/>
		<updated>2013-06-09T17:38:48Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Problem Description ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Non latin support with search queries:&#039;&#039;&#039; Database engines don&#039;t recognize word boundaries in non-english languages and can&#039;t do case-insensitive search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Indexing:&#039;&#039;&#039; We don&#039;t want to reinvent the wheel as there are many awesome open source enterprise level search indexers available that can make our course search fast and efficient.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sorting by relevance:&#039;&#039;&#039; We need to sort results according to relevance for example if a query result matches course name then it&#039;s more relevant then its other matches with summary of course. Implementing spelling correction (Did you mean?) feature. Also fuzzy search (alternate form of words) needs to be implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Work consistently on different database engines and different content language:&#039;&#039;&#039; Course search should be implemented in a way that it can deal with as many databases possible. and it should be able to deal with different content language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40825</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40825"/>
		<updated>2013-06-09T17:34:40Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40824</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40824"/>
		<updated>2013-06-09T17:34:08Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Preparing course search schema to integrate with Apache solr :&#039;&#039;&#039; Solr reads the schema to be indexed using a xml based configuration file, lets call it schema.xml. When user will install advance search plugin, it will contain its schema file that will be automatically replaced by the corresponding files located on the Solr server, and it can usually be found in the main Solr directory solr/conf. We will need to design moodle course search schema.xml depending on what fields we want to index and how. Available field types and filter options in Solr makes it very flexible how we want to do that. Fortunately similar problem has already been sorted out by Drupal folks and I am quite familiar with that so here we can use this knowledge reference. Searchable fields in course are idnumber, shortname, fullname, summary, summary. We will start with these fields for designing the schema for moodle course search.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Extending apache Solr integration library with php to work with moodle :&#039;&#039;&#039; It is the Solr Php Client library that will talk between moodle and Solr. Here we need to extend these files to make it work with moodle course search plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indexing the course search data:&#039;&#039;&#039; The entry point of indexing courses is the Cron task. Whenever the cron will run, an associated callback will trigger the indexing procedure. The plugin will look for courses which are marked for indexing, then for each course an object that contains all the relevant field contents to be indexed, will be individually converted into XML query and sent to the Solr server for indexing. We can also create a custom event to notify other entities that we just performed an indexing operation. How much courses can be indexed at once can be an admin setting. On admin side we will also have means to mark a course as a candidate for reindexing, so -&lt;br /&gt;
&lt;br /&gt;
*    We need to perform re-indexing(by Cron listening)&lt;br /&gt;
          - If a new coursed is created. &lt;br /&gt;
&lt;br /&gt;
          - If a existing course is deleted or updated.&lt;br /&gt;
&lt;br /&gt;
          - Or it is marked by admin to index again&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Plugin search API functions :&#039;&#039;&#039; Internal search API functions will  have these objectives -&lt;br /&gt;
&lt;br /&gt;
1. Getting the basic search query via form submission&lt;br /&gt;
&lt;br /&gt;
2. Translation of this search query into appropriate Apache Solr query and adding appropriate parameters for extra search options&lt;br /&gt;
&lt;br /&gt;
3. Trigger the search by sending this query to locally running Apache Solr instance&lt;br /&gt;
&lt;br /&gt;
4. Getting the search response and rendering the search results via proper theme function.&lt;br /&gt;
&lt;br /&gt;
As we know Advance search is plugin type code base so when installed it will overtake the responsibility of search system. So when the user activates advance search plugin, then moodle will interact with its internal search and to interact with apache solr in backend. These search functions will be responsible to &#039;generate&#039; the required apache solr query and to speak with solr running instance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On caching -&#039;&#039;&#039; While retrieving the list of courses that match search string Apache Solr has the mechanism to cache repetitious search queries. It has two built-in in-memory caches. one for search results and one for documents. They are typically limited to several thousands entries each.&lt;br /&gt;
&lt;br /&gt;
Finally we will prepare the list of courses to show to the user, with filtering out hidden courses that user can not see, retrieve all additional information such as category name, course contacts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Achieving relevancy by using Solr&#039;s awesome faceted search feature:&#039;&#039;&#039; We can achieve relevancy by dynamic filtering results like searching start date(by days,months,years etc.) or spelling correct feature (Did you mean?) and in back-end Solr supports that out of box.&lt;br /&gt;
&lt;br /&gt;
Relevancy is made using the &#039;&#039;boost&#039;&#039; clause on the field you want to give higher relevance. These &amp;quot;boost&amp;quot; clause will be added on search fields by internal search API functions as per the need while generating the search query for Apache Solr. From the Solr docs I found these key points to achieve for relevant results.[2]&lt;br /&gt;
&lt;br /&gt;
By default Apache solr sorts given search results in order of relevancy, and relevancy is defined in terms of how much &#039;boost&#039; we have given to particular field and if some field has to remain more relevant by default than other Apache Solr by altering the schema file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solr with alternate form of words(fuzzy search):-&#039;&#039;&#039; In Apache Solr Text fields are typically indexed by breaking the text into words and applying various transformations such as lower casing  removing plurals, or stemming to increase relevancy. The same text transformations are normally applied to any queries in order to match what is indexed.So when you are searching for &amp;quot;Fly&amp;quot; it also looks for &amp;quot;Flies&amp;quot; or &amp;quot;Flew&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Solr with intra-word delimiters:-&#039;&#039;&#039; The filter &#039;WordDelimiterFilter&#039; can be used in the analyzer for the field being queried to match words with intra-word delimiters such as dashes or case changes. By default apache solr provides lots of filters for text field type to configure these things. Properly configured schema.xml is the key point to handle this.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40730</id>
		<title>GSOC/2013</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=GSOC/2013&amp;diff=40730"/>
		<updated>2013-06-06T18:30:33Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:banner-gsoc2013.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
[[GSOC|GSoC]] &amp;gt; GSoC 2013&lt;br /&gt;
&lt;br /&gt;
An overview of the [http://www.google-melange.com/gsoc/program/home/google/gsoc2013 Google Summer of Code 2013] projects for Moodle..&lt;br /&gt;
&lt;br /&gt;
==Self-assessment activity using the question bank==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1580475&amp;amp;course=5 Jayesh Anandani]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=8026&amp;amp;course=5 Jean-Michel Vedrine] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Self-assessment activity using the question bank]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4334&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==SCORM player rewrite==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1277285&amp;amp;course=5 Mayank Gupta]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[SCORM player rewrite]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-39910&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Global search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1565904&amp;amp;course=5 Prateek Sachan]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=353008&amp;amp;course=5 Tomasz Muras] &amp;amp; [https://moodle.org/user/view.php?id=1146834&amp;amp;course=5 Aparup Banerjee] &lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Global search]]&lt;br /&gt;
See also:&lt;br /&gt;
* MDL-31989&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
==Course search==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Course search]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4335&lt;br /&gt;
* [http://shashitechno.wordpress.com/ Developer blog]&lt;br /&gt;
&lt;br /&gt;
==Pronunciation evaluation question type==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1594272 Troy Lee]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=1081865&amp;amp;course=5 James Salsman] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Pronunciation evaluation question type]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4336&lt;br /&gt;
* [http://pronunciationeval.blogspot.sg/ Developer blog]&lt;br /&gt;
&lt;br /&gt;
==BioAuth: A Moodle plugin for determining Quiz authorship==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1595676 Vinnie Monaco]&lt;br /&gt;
:&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [https://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[BioAuth Plugin]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4337&lt;br /&gt;
* [http://vmonaco.com/blog Developer blog]&lt;br /&gt;
&lt;br /&gt;
==Portfolio plugin for Evernote==&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Student&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1459982 Vishal Raheja]&lt;br /&gt;
:&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=1451616 Frédéric Massart] &amp;amp; [https://moodle.org/user/view.php?id=381842&amp;amp;course=5 Michael de Raadt]&lt;br /&gt;
:&#039;&#039;&#039;Specification&#039;&#039;&#039;: [[Portfolio plugin for Evernote]]&lt;br /&gt;
See also:&lt;br /&gt;
* CONTRIB-4338&lt;br /&gt;
* Developer blog link coming&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40678</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40678"/>
		<updated>2013-06-05T18:35:47Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335 Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40674</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40674"/>
		<updated>2013-06-05T18:15:48Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   [tracker.moodle.org/browse/CONTRIB-4335 CONTRIB-4335]Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40673</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40673"/>
		<updated>2013-06-05T18:14:13Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Tracker */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   [www.tracker.moodle.org/browse/CONTRIB-4335 CONTRIB-4335]Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40672</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40672"/>
		<updated>2013-06-05T18:13:08Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* Tracker */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   [https://tracker.moodle.org/browse/CONTRIB-4335 CONTRIB-4335]Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40671</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40671"/>
		<updated>2013-06-05T18:12:25Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335[https://tracker.moodle.org/browse/CONTRIB-4335]Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]&lt;br /&gt;
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40669</id>
		<title>Course search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Course_search&amp;diff=40669"/>
		<updated>2013-06-05T18:11:06Z</updated>

		<summary type="html">&lt;p&gt;Shashitechno: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work_in_progress}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = Course search&lt;br /&gt;
|state = Community bonding period&lt;br /&gt;
|tracker = CONTRIB-4335&lt;br /&gt;
|discussion = XXX&lt;br /&gt;
|assignee = [https://moodle.org/user/profile.php?id=1565325 Shashikant Vaishnav]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;13&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Object of this google summer of code project is to Implement Advanced Course Search that is flexible, case-insensitive, fast and can sort results by relevance. Most importantly it should work consistently on different Database engines and different content languages. The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. The project will be implemented integrating 3rd party search engine API with Moodle course schema.&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;May 28 - June 17 ( Community Bonding Period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Discuss the further ideas with the mentor .&lt;br /&gt;
&lt;br /&gt;
➢ Final list of tasks to be implemented under this project.&lt;br /&gt;
&lt;br /&gt;
➢ Read &amp;amp; study the documentations on moodle and its Database Schema.&lt;br /&gt;
&lt;br /&gt;
➢ Study the plugin development in moodle.&lt;br /&gt;
&lt;br /&gt;
➢ Study the Apache Solr Documentation &amp;amp; its complete working&lt;br /&gt;
&lt;br /&gt;
➢ Set up the development and testing environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;June 18- july 10( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Start Coding!&lt;br /&gt;
&lt;br /&gt;
➢ Prepare moodle course search schema xml configuration&lt;br /&gt;
&lt;br /&gt;
➢ Create moodle plugins (admin tool and theme) that allow to substitute core search with alternative solution. At first it will duplicate the existing functionality but it is ready for modifications without changing the core.&lt;br /&gt;
&lt;br /&gt;
➢ Create function for manual reindexing of all courses, add button for admin on the plugin page to perform manual reindexing.&lt;br /&gt;
&lt;br /&gt;
➢ Implement the search in the plugin just to make sure it works with the simple result output (no filtering, no pagination, no additional information retrieval, etc)&lt;br /&gt;
&lt;br /&gt;
➢  Document the work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;July 11- August  02( Interim Period )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Display courses properly, filtered, with all additional information&lt;br /&gt;
&lt;br /&gt;
➢ Add caching of search results so everything is not retrieved again when user requests the second page&lt;br /&gt;
&lt;br /&gt;
➢ Prepare search plugin for distrubution: create install/upgrade/uninstall scripts, write Readme file how to install and configure Solr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mid Term Evaluation&lt;br /&gt;
&lt;br /&gt;
Submit code of completed tasks along with documentation.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 3- August 25 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
➢ Listen to events and mark courses for reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Implement cron function that does reindexing&lt;br /&gt;
&lt;br /&gt;
➢ Add configurable settings to the plugin (when/whether to run automatic re indexing)&lt;br /&gt;
&lt;br /&gt;
➢ Document the work.&lt;br /&gt;
&lt;br /&gt;
➢ Debug the code and reduce code complexity.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;August 26- Sep 16 (Interim period)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Filtering results by dates, tags.&lt;br /&gt;
&lt;br /&gt;
➢ Spell correction capability.&lt;br /&gt;
&lt;br /&gt;
➢ Fuzzy search support.&lt;br /&gt;
&lt;br /&gt;
➢ Implement extra functionality (if any other feature required and time permits).&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Sep 17- Sep 23(Pencils down)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
➢ Testing, documentation &amp;amp; debugging.&lt;br /&gt;
&lt;br /&gt;
➢ Final Release&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The deliverable includes a functional advance search plugin for Moodle that can be installed and configured to substitute basic core search. Usually require moodle version 2.6.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Non latin support with search queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Indexing to make course search fast and efficient  &lt;br /&gt;
&lt;br /&gt;
* Sorting by relevance &lt;br /&gt;
&lt;br /&gt;
   *  spelling correction (Did you mean?) feature.&lt;br /&gt;
   *  fuzzy search (alternate form of words).&lt;br /&gt;
&lt;br /&gt;
* Work consistently on different database engines and different content language.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Relevancy Search wireframe:-&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following wireframe shows how the results can be filtered with different aspects.&lt;br /&gt;
&lt;br /&gt;
[[File:Wireframe.png]]&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mentors:&#039;&#039;&#039; [https://moodle.org/user/profile.php?id=1334243&amp;amp;course=5 Marina Glancy] &amp;amp; [https://moodle.org/user/profile.php?id=381842  Michael de Raadt]&lt;br /&gt;
&lt;br /&gt;
== Tracker ==&lt;br /&gt;
&lt;br /&gt;
*   CONTRIB-4335[https://tracker.moodle.org/browse/CONTRIB-4335]Course Search Plugin&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[GSOC/2013|Moodle GSoC projects for 2013]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
*  GSOC Proposal[[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1]]&lt;br /&gt;
*  Original idea[[https://docs.moodle.org/dev/Projects_for_new_developers#Course_search]]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Shashitechno</name></author>
	</entry>
</feed>